]> code.delx.au - gnu-emacs/blobdiff - lisp/url/url-misc.el
Add a couple cells to lisp-prettify-symbols-alist
[gnu-emacs] / lisp / url / url-misc.el
index c8e9b591790f32f1b69fce641622ed763c5f102b..14b9f7eab44cb475c443462baa31dd1751af9cbf 100644 (file)
@@ -1,6 +1,6 @@
 ;;; url-misc.el --- Misc Uniform Resource Locator retrieval code
 
-;; Copyright (C) 1996-1999, 2002, 2004-2013 Free Software Foundation,
+;; Copyright (C) 1996-1999, 2002, 2004-2016 Free Software Foundation,
 ;; Inc.
 
 ;; Keywords: comm, data, processes
@@ -24,6 +24,7 @@
 
 (require 'url-vars)
 (require 'url-parse)
+(declare-function mm-disable-multibyte "mm-util" ())
 (autoload 'Info-goto-node "info" "" t)
 (autoload 'man "man" nil t)
 
     (save-excursion
       (if (not (string-match "\\([^,]*\\)?," desc))
          (error "Malformed data URL: %s" desc)
-       (setq mediatype (match-string 1 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)))
-       (setq data (url-unhex-string (substring desc (match-end 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-Encoding: " encoding "\n"
+             "Content-Transfer-Encoding: " encoding "\n"
              "\n")
       (if data (insert data))
       (current-buffer))))