mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 09:34:57 +09: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: c7409af627
Pull-request: https://github.com/SerenityOS/serenity/pull/18153
Issue: https://github.com/SerenityOS/serenity/issues/18151
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue