1. kcor
  2. CherryPy


kendall_c  committed 49d7ba5

read out remaining request body for chunked transfers

  • Participants
  • Parent commits 5ab187e
  • Branches default

Comments (0)

Files changed (1)

File cherrypy/wsgiserver/wsgiserver2.py

View file
                 self.buffer = self.buffer[remaining:]
                 data += self.buffer
+                self.buffer = EMPTY
     def readline(self, size=None):
         data = EMPTY
                 if not self.close_connection:
                     self.outheaders.append(("Connection", "Keep-Alive"))
-        if (not self.close_connection) and (not self.chunked_read):
+        if (not self.close_connection):
             # Read any remaining request body data on the socket.
             # "If an origin server receives a request that does not include an
             # Expect request-header field with the "100-continue" expectation,
             # requirement is not be construed as preventing a server from
             # defending itself against denial-of-service attacks, or from
             # badly broken client implementations."
-            remaining = getattr(self.rfile, 'remaining', 0)
-            if remaining > 0:
-                self.rfile.read(remaining)
+            self.rfile.read()
         if "date" not in hkeys:
             self.outheaders.append(("Date", rfc822.formatdate()))