diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2021-04-14 09:20:25 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-14 09:31:31 +0200 |
commit | 339ae7873e788e7f52e6277ef8e76c5afde568a8 (patch) | |
tree | ac599a1cc69f2ea28ee1bc813eb217f2d5ca52e4 /Userland | |
parent | 5da4c9bf1e538e73b947652e61f2e8ffcb31005c (diff) | |
download | serenity-339ae7873e788e7f52e6277ef8e76c5afde568a8.zip |
LibHTTP: Trim the whitespace around the Transfer-Encoding header value
Fixes #6302.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibHTTP/Job.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibHTTP/Job.cpp b/Userland/Libraries/LibHTTP/Job.cpp index 0a06eed32a..e41cd7d3a3 100644 --- a/Userland/Libraries/LibHTTP/Job.cpp +++ b/Userland/Libraries/LibHTTP/Job.cpp @@ -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")) { |