GNU bug report logs -
#15285
url-data not working for base64-encoded data
Previous Next
Full log
Message #10 received at 15285-done <at> debbugs.gnu.org (full text, mbox):
Version: 24.4
Thanks for the clear report.
(I needed to add a "(require 'mm-view)" to the test-case).
I think this fixes it:
*** lisp/url/url-misc.el 2013-01-02 16:13:04 +0000
--- lisp/url/url-misc.el 2013-09-16 21:28:11 +0000
***************
*** 89,107 ****
(save-excursion
(if (not (string-match "\\([^,]*\\)?," desc))
(error "Malformed data URL: %s" desc)
! (setq mediatype (match-string 1 desc))
(if (and mediatype (string-match ";base64\\'" mediatype))
(setq mediatype (substring mediatype 0 (match-beginning 0))
encoding "base64"))
(if (or (null mediatype)
(eq ?\; (aref mediatype 0)))
! (setq mediatype (concat "text/plain" mediatype)))
! (setq data (url-unhex-string (substring desc (match-end 0)))))
(set-buffer (generate-new-buffer " *url-data*"))
(mm-disable-multibyte)
(insert (format "Content-Length: %d\n" (length data))
"Content-Type: " mediatype "\n"
! "Content-Encoding: " encoding "\n"
"\n")
(if data (insert data))
(current-buffer))))
--- 88,106 ----
(save-excursion
(if (not (string-match "\\([^,]*\\)?," desc))
(error "Malformed data URL: %s" desc)
! (setq mediatype (match-string 1 desc)
! data (url-unhex-string (substring desc (match-end 0))))
(if (and mediatype (string-match ";base64\\'" mediatype))
(setq mediatype (substring mediatype 0 (match-beginning 0))
encoding "base64"))
(if (or (null mediatype)
(eq ?\; (aref mediatype 0)))
! (setq mediatype (concat "text/plain" mediatype))))
(set-buffer (generate-new-buffer " *url-data*"))
(mm-disable-multibyte)
(insert (format "Content-Length: %d\n" (length data))
"Content-Type: " mediatype "\n"
! "Content-Transfer-Encoding: " encoding "\n"
"\n")
(if data (insert data))
(current-buffer))))
This bug report was last modified 11 years and 245 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.