yohanboniface / falcon-multipart

[Experimental] Parse multipart/form-data in falcon
MIT License
58 stars 11 forks source link

Not supporting POST requests with no parameters #11

Open mastergap opened 7 years ago

mastergap commented 7 years ago

If a POST request is sent with no parameters the request get stucked, when the request is stopped the following error is raised:

Traceback (most recent call last): File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socketserver.py", line 317, in _handle_request_noblock self.process_request(request, client_address) File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socketserver.py", line 348, in process_request self.finish_request(request, client_address) File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socketserver.py", line 361, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socketserver.py", line 696, in __init__ self.handle() File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/wsgiref/simple_server.py", line 133, in handle handler.run(self.server.get_app()) File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/wsgiref/handlers.py", line 144, in run self.close() File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/wsgiref/simple_server.py", line 35, in close self.status.split(' ',1)[0], self.bytes_sent AttributeError: 'NoneType' object has no attribute 'split'

EDIT: this problem seems to happen only when sending multipart/form-data POST requests without parameters from Postman. I debugged your code and it get stuck parsing the request stream without closing the connection. I tried sending a request from CURL instead and it raises a value error.

yohanboniface commented 7 years ago

Sorry, I missed that issue. Can you provided a test case? I'll work on a fix.

dexax commented 5 years ago

AFASIK The problem isn't even bound with the falcon-multipart. Its more problem with the wsgiref + long running requests because under the gunicorn this error doesn't occur.