Commits

Michael Tharp committed 132e6de

Deal with empty content-length headers

This is probably from WSGI app servers trying to be helpful.

  • Participants
  • Parent commits 893fee0

Comments (0)

Files changed (1)

File restlib/http/request.py

         Returns the expected content length to be read from the current
         request.
         """
-        return int(self.headers.get('content-length', 0))
+        return int(self.headers.get('content-length') or 0)
 
     def _getPostData(self):
         """