Subject: bug#17914: 23.3;92: eww-download-callback

From: Charles Rendleman <[email-masked]>
Date: Thu, 3 Jul 2014 11:41:08 -0400

eww-download-callback should remove the HTTP header before saving the file
after a download.

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 02fc575..cff85a5 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1075,7 +1075,9 @@ Differences in #targets are ignored."
            (path (car (url-path-and-query obj)))
            (file (eww-make-unique-file-name (file-name-nondirectory path)
                                            eww-download-directory)))
-      (write-file file)
+      (goto-char 0)
+      (re-search-forward "\r?\n\r?\n")
+      (write-region (point) (point-max) file)
       (message "Saved %s" file))))

 (defun eww-make-unique-file-name (file directory)