mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 09:17:35 +00:00
LibHTTP: Make reason phrase of HTTP response's status line optional
According to rfc2616 section 6.1 the text of reason phrase is not defined and can be replaced by server. Some servers (for example http://linux.org.ru) leave it empty. This change fixes parsing of HTTP responses with empty reason phrase.
This commit is contained in:
parent
78ef608a6b
commit
e379147f64
1 changed files with 2 additions and 2 deletions
|
@ -243,8 +243,8 @@ void Job::on_socket_connected()
|
|||
return deferred_invoke([this] { did_fail(Core::NetworkJob::Error::TransmissionFailed); });
|
||||
}
|
||||
auto parts = line.split_view(' ');
|
||||
if (parts.size() < 3) {
|
||||
dbgln("Job: Expected 3-part HTTP status, got '{}'", line);
|
||||
if (parts.size() < 2) {
|
||||
dbgln("Job: Expected 2-part or 3-part HTTP status line, got '{}'", line);
|
||||
return deferred_invoke([this] { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
|
||||
}
|
||||
auto code = parts[1].to_uint();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue