branch: elpa/mastodon
commit a95bae27559b7135d3f5a78584dd5cfb52398923
Merge: a161f3803e a825e44f45
Author: martianh <[email protected]>
Commit: martianh <[email protected]>

    Merge pull request 'http: trim the json-string' (#688) from 
rayslava/mastodon.el:feature/http_empty_response into develop
---
 lisp/mastodon-http.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el
index a55097dff2..a91f272dd4 100644
--- a/lisp/mastodon-http.el
+++ b/lisp/mastodon-http.el
@@ -220,9 +220,10 @@ Callback to `mastodon-http--get-response-async', usually
     (goto-char (point-min))
     (re-search-forward "^$" nil 'move)
     (let ((json-array-type (if vector 'vector 'list))
-          (json-string (decode-coding-string
-                        (buffer-substring-no-properties (point) (point-max))
-                        'utf-8)))
+          (json-string (string-trim-right
+                        (decode-coding-string
+                         (buffer-substring-no-properties (point) (point-max))
+                         'utf-8))))
       (kill-buffer)
       (cond ((or (string-empty-p json-string) (null json-string))
              nil)

Reply via email to