ncr / rack-proxy

A request/response rewriting HTTP proxy. A Rack app.
MIT License
269 stars 94 forks source link

Handle response with Transfer-Encoding: chunked header gracefully. #51

Closed westoque closed 8 years ago

westoque commented 9 years ago

Right now, it just passes through, although Rack::Lint shows a warning. There is a streaming api however, and we should use it or suggest to use it when this happens.

Using:

rack-proxy - 0.5.17

Reproduce:

  1. Proxy request to site with Transfer-Encoding: chunked header.
  2. Get incomplete response rendered in browser.

What should happen:

We should get the complete response rendered in browser.

timting commented 9 years ago

I'm experiencing this too. Does anyone have any pointers as to how we could fix this up?

westoque commented 9 years ago

@timting Actually, my problem before was proxying from https -> http. If this is also true with your setup. Then you can solve this by doing forcing the request to use http.

env["HTTP_X_FORWARDED_PROTO"] = "http"
env["HTTP_X_FORWARDED_PORT"] = "80"
twinge commented 8 years ago

I'm having this problem as well, and it's not an issue with the HTTP_X_FORWARDED_PROTO. Anyone come up with any ideas? @timting?

twinge commented 8 years ago

Just noticed this appears to be a duplicate of #50

ncr commented 8 years ago

Yup. Closing.