waterlink / rack-reverse-proxy

A Reverse Proxy for Rack
MIT License
196 stars 52 forks source link

Remove Status key from response_headers as per the Rack protocol #7

Closed janraasch closed 9 years ago

janraasch commented 9 years ago

see Rack::Lint, https://github.com/rack/rack/blob/master/lib/rack/lint.rb#L639.

waterlink commented 9 years ago

Hi @janraasch, thanks for PR!

Have you tried to use this in some application?

My concern is: what happens to the original Status application behind reverse proxy have returned? How it gets forwarded to the original client if you remove Status response header?

janraasch commented 9 years ago

Hi @waterlink,

yes, I am using this. I ran into problems when running my rails app in development mode, since Rack::Lint is then active by default, which is why I looked into this.

To answer your concern. I believe it gets forwarded correctly as we do pass down the status as the first array entry target_response.status in https://github.com/tolingo/rack-reverse-proxy/blob/feature/remove-status/lib/rack/reverse_proxy.rb#L97. So the app can hence set the real "Status" header correctly when returning the request to the client.

waterlink commented 9 years ago

LGTM then

waterlink commented 9 years ago

@janraasch thanks!

waterlink commented 9 years ago

Just pushed 0.9.1 to rubygems

janraasch commented 9 years ago

Great. Thank you!