LibHTTP: Trim the whitespace around the Transfer-Encoding header value

Fixes #6302.
This commit is contained in:
AnotherTest 2021-04-14 09:20:25 +04:30 committed by Andreas Kling
parent 5da4c9bf1e
commit 339ae7873e
Notes: sideshowbarker 2024-07-18 20:24:13 +09:00

View file

@ -288,7 +288,8 @@ void Job::on_socket_connected()
} else {
auto transfer_encoding = m_headers.get("Transfer-Encoding");
if (transfer_encoding.has_value()) {
auto encoding = transfer_encoding.value();
// Note: Some servers add extra spaces around 'chunked', see #6302.
auto encoding = transfer_encoding.value().trim_whitespace();
dbgln_if(JOB_DEBUG, "Job: This content has transfer encoding '{}'", encoding);
if (encoding.equals_ignoring_case("chunked")) {