mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:57:47 +00:00
LibHTTP: Reset m_content_length if there's a Transfer-Encoding header
This commit is contained in:
parent
89c87ff7b9
commit
78bebb363b
1 changed files with 5 additions and 0 deletions
|
@ -288,6 +288,11 @@ void Job::on_socket_connected()
|
||||||
} else {
|
} else {
|
||||||
auto transfer_encoding = m_headers.get("Transfer-Encoding");
|
auto transfer_encoding = m_headers.get("Transfer-Encoding");
|
||||||
if (transfer_encoding.has_value()) {
|
if (transfer_encoding.has_value()) {
|
||||||
|
// HTTP/1.1 3.3.3.3:
|
||||||
|
// If a message is received with both a Transfer-Encoding and a Content-Length header field, the Transfer-Encoding overrides the Content-Length. [...]
|
||||||
|
// https://httpwg.org/specs/rfc7230.html#message.body.length
|
||||||
|
m_content_length = {};
|
||||||
|
|
||||||
// Note: Some servers add extra spaces around 'chunked', see #6302.
|
// Note: Some servers add extra spaces around 'chunked', see #6302.
|
||||||
auto encoding = transfer_encoding.value().trim_whitespace();
|
auto encoding = transfer_encoding.value().trim_whitespace();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue