yohanboniface / falcon-multipart

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

wsgiref.simple_server.make_server support #1

Closed yohanboniface closed 6 years ago

yohanboniface commented 8 years ago

It does not work at the moment when serving falcon with wsgiref.simple_server.make_server.

Roughly, this gives an io.BufferedReader instance as request body (req.stream in falcon), which seems to consume all the stream when calling readline on it (which is what cgi does on FieldStorage.parse_multi).

kojimaeiji commented 7 years ago

i fixed this in https://github.com/yohanboniface/falcon-multipart/pull/5.

yunfan commented 7 years ago

the patch not work but you could add the bellow line to let it work

from StringIO import StringIO
new_stream = StringIO(req.stream.read())
form = self.parse(stream=new_stream, environ=req.env) 

but this method will duplicate the memory usage i think which might cause problem while processing large file uploading, also it break the streamming processing

yohanboniface commented 6 years ago

Should be fixed by #10