mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +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
Notes:
sideshowbarker
2024-07-19 12:54:34 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/273d9d6cf57
1 changed files with 7 additions and 4 deletions
|
@ -91,10 +91,13 @@ void CHttpJob::on_socket_connected()
|
|||
}
|
||||
buffer.append(payload.pointer(), payload.size());
|
||||
|
||||
bool ok;
|
||||
if (buffer.size() >= m_headers.get("Content-Length").value_or("0").to_int(ok) && ok) {
|
||||
m_state = State::Finished;
|
||||
break;
|
||||
auto content_length_header = m_headers.get("Content-Length");
|
||||
if (content_length_header.has_value()) {
|
||||
bool ok;
|
||||
if (buffer.size() >= content_length_header.value().to_int(ok) && ok) {
|
||||
m_state = State::Finished;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue