Commits

Tarek Ziadé committed 2fe00e2

handle request with empty data

Comments (0)

Files changed (1)

 
 store.keep_conn = True
 
-CONFIG_FILE = '/data/pypi/config.ini'
+CONFIG_FILE = 'config.ini'
 
 class Request:
 
     def __init__(self, environ, start_response):
         self.start_response = start_response
-        length = int(environ['CONTENT_LENGTH'])
+        try:
+            length = int(environ['CONTENT_LENGTH'])
+        except ValueError:
+            length = 0
         self.rfile = cStringIO.StringIO(environ['wsgi.input'].read(length))
         self.wfile = cStringIO.StringIO()
         self.config = config.Config(CONFIG_FILE )