Skip to content

New: Proxy with PEP 333-compliant chunked-response support (based on Paste's Proxy class) #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

alanjds
Copy link

@alanjds alanjds commented Apr 29, 2013

I tried to figure out some bug about partial responses using HostProxy. It occur on requests that works fine with Paste's Proxy middleware. Finally, I found the problem to be the HostProxy implementation of chunked responses.

By some PEP 333 chapter, only the server MAY add chunked responses headers, but it usually does so only if Content-Length is not set. At least Gunicorn seems to do chunked very fine, if no Content-Length is set, AFAIK.

So, I copied over paste.proxy.Proxy code as a new starting point and adapted to use restkit client and to allow streaming of the client response.

This works very good for me. I added no tests, but its working over my blog http://kombobreaker.com/blog

I dont know where the new class should be: wsgi_proxy.py or a new module?
Waiting for your feedback and/or merge.

@benoitc
Copy link
Owner

benoitc commented Aug 30, 2013

hi sorry for the delay. It should be another module imo , so the import of paste will be fine. I will try to apply this change asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants