we don't support chunked transfer encoding, strip that from the response headeers
This commit is contained in:
parent
4924955c6c
commit
efcc6585a6
|
@ -37,6 +37,7 @@ class Roda
|
||||||
def proxy
|
def proxy
|
||||||
method = Faraday.method(env['REQUEST_METHOD'].downcase.to_sym)
|
method = Faraday.method(env['REQUEST_METHOD'].downcase.to_sym)
|
||||||
f_response = method.call(_proxy_url) { |req| _proxy_request(req) }
|
f_response = method.call(_proxy_url) { |req| _proxy_request(req) }
|
||||||
|
# p f_response
|
||||||
_respond(f_response)
|
_respond(f_response)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -92,7 +93,10 @@ class Roda
|
||||||
|
|
||||||
def _respond(proxied_response)
|
def _respond(proxied_response)
|
||||||
response.status = proxied_response.status
|
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['Via'] = _via_header_string
|
||||||
response.write(proxied_response.body)
|
response.write(proxied_response.body)
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
class Roda
|
class Roda
|
||||||
module Proxy
|
module Proxy
|
||||||
VERSION = '1.0.4'
|
VERSION = '1.0.5'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue