GNU bug report logs - #15285
url-data not working for base64-encoded data

Previous Next

Package: emacs;

Reported by: Klaus Straubinger <KSNetz <at> UseNet.ArcorNews.DE>

Date: Fri, 6 Sep 2013 09:24:02 UTC

Severity: normal

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Klaus Straubinger <KSNetz <at> UseNet.ArcorNews.DE>
To: bug-gnu-emacs <at> gnu.org
Subject: url-data not working for base64-encoded data
Date: Fri, 6 Sep 2013 11:22:59 +0200 (Mitteleuropäische
 Sommerzeit)
In GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601),
evaluating

    (require 'mm-decode)
    (require 'url)
    (mm-display-part
     (with-current-buffer
         (url-retrieve-synchronously
          "data:image/x-portable-bitmap;base64,UDQKMTQgMTAK//zgHJAkiESHhItEkCSgFMAM//w=")
       (mm-dissect-buffer t)))

should insert a letter image into the current buffer, but this does not work.

The cause is that in the function url-data (defined in url-misc.el)
the handling of the base64 parameter moves the match end and so the
starting "," character gets into the data, making them invalid.

Furthermore, instead of inserting the header "Content-Encoding" (that
should be used for encodings like "gzip") the code should insert the
header "Content-Transfer-Encoding" (the correct one for "8bit" or "base64").

-- 
Klaus Straubinger




This bug report was last modified 11 years and 244 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.