mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:47:34 +00:00
CHttpJob: If no "Content-Length" header was received, read until EOF
Instead of aborting after receiving the first chunk, we have to keep reading until EOF.
This commit is contained in:
parent
6797f71e73
commit
273d9d6cf5
1 changed files with 7 additions and 4 deletions
|
@ -91,10 +91,13 @@ void CHttpJob::on_socket_connected()
|
||||||
}
|
}
|
||||||
buffer.append(payload.pointer(), payload.size());
|
buffer.append(payload.pointer(), payload.size());
|
||||||
|
|
||||||
bool ok;
|
auto content_length_header = m_headers.get("Content-Length");
|
||||||
if (buffer.size() >= m_headers.get("Content-Length").value_or("0").to_int(ok) && ok) {
|
if (content_length_header.has_value()) {
|
||||||
m_state = State::Finished;
|
bool ok;
|
||||||
break;
|
if (buffer.size() >= content_length_header.value().to_int(ok) && ok) {
|
||||||
|
m_state = State::Finished;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue