diff options
author | Eric Wong <e@80x24.org> | 2015-03-03 07:54:55 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-03-03 07:55:13 +0000 |
commit | 94538f003c4031f33eb6545032bd234e483e65c6 (patch) | |
tree | 0d66340d7d4e83668035c3f3d8c7f850b716023a /extras | |
parent | c98942ca949e3d210c4c61939f1e3e18ccd466a8 (diff) | |
download | yahns-94538f003c4031f33eb6545032bd234e483e65c6.tar.gz |
This module will probably become an official part of yahns soon, so finally add tests for this module.
Diffstat (limited to 'extras')
-rw-r--r-- | extras/proxy_pass.rb | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/extras/proxy_pass.rb b/extras/proxy_pass.rb index de6a2b1..0bec4ee 100644 --- a/extras/proxy_pass.rb +++ b/extras/proxy_pass.rb @@ -135,12 +135,7 @@ class ProxyPass # :nodoc: end def call(env) - case request_method = env["REQUEST_METHOD"] - when "GET", "HEAD" # OK - else - return [ 405, [%w(Content-Length 0), %w(Content-Length 0)], [] ] - end - + request_method = env['REQUEST_METHOD'] req = Rack::Request.new(env) path = @path.gsub(/\$(\w+)/) { req.__send__($1.to_sym) } req = "#{request_method} #{path} HTTP/1.1\r\n" \ @@ -204,7 +199,7 @@ class ProxyPass # :nodoc: buf.replace("#{buf.size.to_s(16)}\r\n#{buf}\r\n") ures.req_write(buf, @timeout) end - ures.req_write("0\r\n\r\n") + ures.req_write("0\r\n\r\n", @timeout) else # common if we hit uploads while input.read(16384, buf) ures.req_write(buf, @timeout) |