fix error

This commit is contained in:
邱博亞 2023-04-02 23:21:58 +08:00
parent b5a297e875
commit 42c8b4f45f
1 changed files with 3 additions and 9 deletions

View File

@ -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