diff --git a/lib/roda/proxy.rb b/lib/roda/proxy.rb index 6f6e33a..16b4792 100644 --- a/lib/roda/proxy.rb +++ b/lib/roda/proxy.rb @@ -37,6 +37,7 @@ class Roda def proxy method = Faraday.method(env['REQUEST_METHOD'].downcase.to_sym) f_response = method.call(_proxy_url) { |req| _proxy_request(req) } +# p f_response _respond(f_response) end @@ -92,7 +93,10 @@ class Roda def _respond(proxied_response) response.status = proxied_response.status - proxied_response.headers.each { |k, v| response[k] = v } + proxied_response + .headers + .reject { |k, v| k.downcase == 'transfer-encoding' } + .each { |k, v| response[k] = v } response['Via'] = _via_header_string response.write(proxied_response.body) end diff --git a/lib/roda/proxy/version.rb b/lib/roda/proxy/version.rb index cbb4f95..6514687 100644 --- a/lib/roda/proxy/version.rb +++ b/lib/roda/proxy/version.rb @@ -2,6 +2,6 @@ class Roda module Proxy - VERSION = '1.0.4' + VERSION = '1.0.5' end end