mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:27:44 +00: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();
|
auto size_data = maybe_size_data.release_value();
|
||||||
|
|
||||||
if (m_should_read_chunk_ending_line) {
|
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());
|
VERIFY(size_data.is_empty());
|
||||||
m_should_read_chunk_ending_line = false;
|
m_should_read_chunk_ending_line = false;
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue