diff options
Diffstat (limited to 'lib/yahns/proxy_pass.rb')
-rw-r--r-- | lib/yahns/proxy_pass.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/yahns/proxy_pass.rb b/lib/yahns/proxy_pass.rb index 3812dbf..e3ba7f0 100644 --- a/lib/yahns/proxy_pass.rb +++ b/lib/yahns/proxy_pass.rb @@ -205,7 +205,13 @@ class Yahns::ProxyPass # :nodoc: req = @path.gsub(/\$(\w+)/) { req.__send__($1) } # start the connection asynchronously and early so TCP can do a - req = "#{env['REQUEST_METHOD']} #{req} HTTP/1.1\r\n" \ + case ver = env['HTTP_VERSION'] + when 'HTTP/1.1' # leave alone, response may be chunked + else # no chunking for HTTP/1.0 and HTTP/0.9 + ver = 'HTTP/1.0'.freeze + end + + req = "#{env['REQUEST_METHOD']} #{req} #{ver}\r\n" \ "X-Forwarded-For: #{env["REMOTE_ADDR"]}\r\n" # pass most HTTP_* headers through as-is |