diff --git a/lib/roda/proxy.rb b/lib/roda/proxy.rb index f2b5dad..48103be 100644 --- a/lib/roda/proxy.rb +++ b/lib/roda/proxy.rb @@ -86,24 +86,18 @@ class Roda .join('-') end .merge({ - 'Host' => "localhost", - 'Via' => _via_header_string + 'Host' => "127.0.0.1" }) end def _respond(proxied_response) - response.status = proxied_response.status + response.status = proxied_response.code.to_i proxied_response - .headers + .each_header.to_h .reject { |k, v| k.downcase == 'transfer-encoding' } .each { |k, v| response[k] = v } - response['Via'] = _via_header_string response.write(proxied_response.body) end - - def _via_header_string - "#{env['SERVER_PROTOCOL']} #{env['SERVER_NAME']}:#{env['SERVER_PORT']}" - end end end