Browse Source

LibHTTP: Ignore empty reads on chunk boundaries

Ali Mohammad Pur 3 years ago
parent
commit
fdd2d49c5b
1 changed files with 2 additions and 0 deletions
  1. 2 0
      Userland/Libraries/LibHTTP/Job.cpp

+ 2 - 0
Userland/Libraries/LibHTTP/Job.cpp

@@ -240,6 +240,8 @@ void Job::on_socket_connected()
                     auto size_lines = size_data.view().lines();
                     dbgln_if(JOB_DEBUG, "Job: Received a chunk with size '{}'", size_data);
                     if (size_lines.size() == 0) {
+                        if (!eof())
+                            return AK::IterationDecision::Continue;
                         dbgln("Job: Reached end of stream");
                         finish_up();
                         return IterationDecision::Break;