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." class url-http-response-status))) (if (not success) (url-mark-buffer-as-dead buffer) + ;; Narrow the buffer for url-handle-content-transfer-encoding to + ;; find only the headers relevant to this transaction. + (and (not (buffer-narrowed-p) + (mail-narrow-to-head))) (url-handle-content-transfer-encoding)) (url-http-debug "Finished parsing HTTP headers: %S" success) (widen)