mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
LibHTTP: Tolerate extra \r\n in chunked-encoding last block size
Some servers put CR/LF there, so let's tolerate that behaviour. Fixes #18151.
This commit is contained in:
parent
289285cd6e
commit
c7409af627
Notes:
sideshowbarker
2024-07-17 09:47:09 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/c7409af627 Pull-request: https://github.com/SerenityOS/serenity/pull/18153 Issue: https://github.com/SerenityOS/serenity/issues/18151
@ -416,6 +416,9 @@ void Job::on_socket_connected()
|
||||
auto size_data = maybe_size_data.release_value();
|
||||
|
||||
if (m_should_read_chunk_ending_line) {
|
||||
// NOTE: Some servers seem to send an extra \r\n here despite there being no size.
|
||||
// This makes us tolerate that.
|
||||
size_data = size_data.trim("\r\n"sv, TrimMode::Right);
|
||||
VERIFY(size_data.is_empty());
|
||||
m_should_read_chunk_ending_line = false;
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user