rack-reverse-proxy
rack-reverse-proxy copied to clipboard
adding :strip_headers option to matcher and reverse_proxy_options
When using reverse-proxy to retrieve embedded file attachments from Riak, we found it necessary to screen certain headers from being emitted. I've written this in, with tests, and offer it to you for your consideration. I've updated the README to reflect the changes, but here they are in short:
use Rack::ReverseProxy do
# Set :strip_headers to remove headers that should not be passed along
reverse_proxy_options :preserve_host => true, :strip_headers => ['REFERER']
# Alternatively
reverse_proxy '/test', 'http://example.com/', { :strip_headers => ['REFERER'] }
end
Thanks.
This pull request passes (merged 6fab3789 into 611c7758).