mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-23 04:55:15 +00:00
LibHTTP: Skip the body when response code is 204
...even if the headers claim that there's some data in the form of Content-Length. This finally fixes loading Discord with RequestServer ConnectionCache on :^)
This commit is contained in:
parent
cb7becb067
commit
9ff22ac7e0
Notes:
sideshowbarker
2024-07-17 19:05:49 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/9ff22ac7e0 Pull-request: https://github.com/SerenityOS/serenity/pull/12394
1 changed files with 5 additions and 0 deletions
|
@ -310,6 +310,11 @@ void Job::on_socket_connected()
|
|||
if (result.value() == 0 && !m_headers.get("Transfer-Encoding"sv).value_or(""sv).view().trim_whitespace().equals_ignoring_case("chunked"sv))
|
||||
return finish_up();
|
||||
}
|
||||
// There's also the possibility that the server responds with 204 (No Content),
|
||||
// and manages to set a Content-Length anyway, in such cases ignore Content-Length and quit early;
|
||||
// As the HTTP spec explicitly prohibits presence of Content-Length when the response code is 204.
|
||||
if (m_code == 204)
|
||||
return finish_up();
|
||||
|
||||
can_read_line = m_socket->can_read_line();
|
||||
if (can_read_line.is_error())
|
||||
|
|
Loading…
Add table
Reference in a new issue