summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-05-20 02:05:53 +0430
committerAndreas Kling <kling@serenityos.org>2021-05-19 23:57:04 +0200
commita57f152ec74750142d07e8dc804f3f3f6c925710 (patch)
treede51b3cf3fd9249f504b9884bbce046ea34400fb /Userland/Libraries
parent832e9c6e02b3629db8d5303fb94ec9d0e7a7b145 (diff)
downloadserenity-a57f152ec74750142d07e8dc804f3f3f6c925710.zip
LibHTTP: Relax the assertion on extra reads after transfer is finished
This was added in #4831, but it didn't account for extra newlines after the response (seems like some servers like to do this).
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibHTTP/Job.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/Userland/Libraries/LibHTTP/Job.cpp b/Userland/Libraries/LibHTTP/Job.cpp
index bed513576b..378fe4cb12 100644
--- a/Userland/Libraries/LibHTTP/Job.cpp
+++ b/Userland/Libraries/LibHTTP/Job.cpp
@@ -125,12 +125,9 @@ void Job::on_socket_connected()
return;
if (m_state == State::Finished) {
- // This is probably just a EOF notification, which means we should receive nothing
- // and then get eof() == true.
- [[maybe_unused]] auto payload = receive(64);
- // These assertions are only correct if "Connection: close".
- VERIFY(payload.is_empty());
- VERIFY(eof());
+ // We have everything we want, at this point, we can either get an EOF, or a bunch of extra newlines
+ // (unless "Connection: close" isn't specified)
+ // So just ignore everything after this.
return;
}