|
From: Adam S. <as...@ko...> - 2019-04-15 14:38:27
|
Adam Sjøgren writes:
> The only thing I haven't been able to figure out is that I get a
> multibyte HTTP request error the second time I call
> jabber-http-file-upload - so I can send one image, then I have to
> restart Emacs to send another. Which is kind of annoying.
I have found the cause of this.
For some reason the variable "mime" is multibyte after the first
invocation, and it is used to set the extra-header "Content-Type", but
in url-http the "request" then gets upgraded to multibyte, and the error
ensues.
This fixes it:
--- a/jabber-http-file-upload.el
+++ b/jabber-http-file-upload.el
@@ -69,7 +69,7 @@
(defun jabber-http-file-upload-request-cb (jc xml-data data)
(message "call jabber-http-file-upload-request-cb")
- (let* ((mime (plist-get data :mime))
+ (let* ((mime (string-to-unibyte (plist-get data :mime)))
(file (plist-get data :file))
(put (nth 1 (cdar (jabber-xml-get-children (jabber-iq-query xml-data)
'put))))
(All changes on https://koldfront.dk/git/jabber-http-file-upload/)
I have now reached "inline images in jabber.el"-nirvana. Easter vacation joy!
Best regards,
Adam
--
"Everything needs to change. Adam Sjøgren
And it has to start today." as...@ko...
|