mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05: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
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
Reference in a new issue