]> granicus.if.org Git - curl/commit
http: don't parse body-related headers bodyless responses
authorMichael Kaufmann <mail@michael-kaufmann.ch>
Sun, 2 Jun 2019 13:16:52 +0000 (15:16 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 2 Jun 2019 20:58:04 +0000 (22:58 +0200)
commit2e5ceb3934a7bc5422c5a3a18daafa1b1af02090
tree27006fc16621dabd144bc76b2e2511a1ca5cf94c
parent7e590b3ecd2d4c061d8e001b25b869460bbdc560
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
lib/http.c
lib/urldata.h
tests/data/test1429