aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2019-08-14 17:53:14 +0300
committerEli Zaretskii2019-08-14 17:53:14 +0300
commit629068a89d1b2a7babbed7d3f5778834a970de16 (patch)
tree2fa8bdf886ee6dce0ea9cd9a8349f6017fd620cb
parentf4974d6fe6137f436763998be27afafea9866098 (diff)
downloademacs-629068a89d1b2a7babbed7d3f5778834a970de16.tar.gz
emacs-629068a89d1b2a7babbed7d3f5778834a970de16.zip
Fix fetching URLs with stuff that looks like HTTP headers
* lisp/url/url-http.el (url-http-parse-headers): Narrow the buffer to the headers at the beginning to make sure url-handle-content-transfer-encoding uses the correct headers. (Bug#37023)
-rw-r--r--lisp/url/url-http.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 9b690778fc0..94d1ba9668b 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -949,6 +949,10 @@ should be shown to the user."
949 class url-http-response-status))) 949 class url-http-response-status)))
950 (if (not success) 950 (if (not success)
951 (url-mark-buffer-as-dead buffer) 951 (url-mark-buffer-as-dead buffer)
952 ;; Narrow the buffer for url-handle-content-transfer-encoding to
953 ;; find only the headers relevant to this transaction.
954 (and (not (buffer-narrowed-p)
955 (mail-narrow-to-head)))
952 (url-handle-content-transfer-encoding)) 956 (url-handle-content-transfer-encoding))
953 (url-http-debug "Finished parsing HTTP headers: %S" success) 957 (url-http-debug "Finished parsing HTTP headers: %S" success)
954 (widen) 958 (widen)