diff options
author | Michael Kaufmann <mail@michael-kaufmann.ch> | 2019-06-02 15:16:52 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-06-02 22:58:04 +0200 |
commit | 2e5ceb3934a7bc5422c5a3a18daafa1b1af02090 (patch) | |
tree | 27006fc16621dabd144bc76b2e2511a1ca5cf94c /lib/urldata.h | |
parent | 7e590b3ecd2d4c061d8e001b25b869460bbdc560 (diff) |
http: don't parse body-related headers bodyless responses
Responses with status codes 1xx, 204 or 304 don't have a response body. For
these, don't parse these headers:
- Content-Encoding
- Content-Length
- Content-Range
- Last-Modified
- Transfer-Encoding
This change ensures that HTTP/2 upgrades work even if a
"Content-Length: 0" or a "Transfer-Encoding: chunked" header is present.
Co-authored-by: Daniel Stenberg
Closes #3702
Fixes #3968
Closes #3977
Diffstat (limited to 'lib/urldata.h')
-rw-r--r-- | lib/urldata.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/urldata.h b/lib/urldata.h index af51b6942..42fb82fdd 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -617,8 +617,8 @@ struct SingleRequest { bit upload_done:1; /* set to TRUE when doing chunked transfer-encoding upload and we're uploading the last chunk */ bit ignorebody:1; /* we read a response-body but we ignore it! */ - bit ignorecl:1; /* This HTTP response has no body so we ignore the - Content-Length: header */ + bit http_bodyless:1; /* HTTP response status code is between 100 and 199, + 204 or 304 */ bit chunk:1; /* if set, this is a chunked transfer-encoding */ bit upload_chunky:1; /* set TRUE if we are doing chunked transfer-encoding on upload */ |