diff options
| author | Eli Zaretskii | 2019-08-14 17:53:14 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2019-08-14 17:53:14 +0300 |
| commit | 629068a89d1b2a7babbed7d3f5778834a970de16 (patch) | |
| tree | 2fa8bdf886ee6dce0ea9cd9a8349f6017fd620cb | |
| parent | f4974d6fe6137f436763998be27afafea9866098 (diff) | |
| download | emacs-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.el | 4 |
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) |