diff options
author | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-01-07 11:05:22 +0000 |
---|---|---|
committer | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-01-07 11:05:22 +0000 |
commit | 36c839f233cf77d4992bedc2a26f35b5529eb389 () | |
tree | b30a56334373e885a5336b7966c6491c9b53a058 /lib/webrick/httpproxy.rb | |
parent | fe1019c6659b5f628c751d289e73456e1da2313f (diff) |
* lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#proxy_service):
should delete trailing LF from the result of pack("m*"). * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#proxy_connect): - should delete trailing LF from the result of pack("m*"). - clear Request-Line not to send the sesponse by HTTPServer#run. * lib/webrick/httputils (WEBrick::HTTPUtils.parse_qvalues): refine regexp (and change the name of a local variable). * lib/webrick/server.rb (WEBrick::Daemon.start): prepared stdio don't allow changing its mode. * test/webrick/*, sample/webrick/httpproxy.rb: add new files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | lib/webrick/httpproxy.rb | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -15,6 +15,14 @@ require "net/http" Net::HTTP::version_1_2 if RUBY_VERSION < "1.7" module WEBrick class HTTPProxyServer < HTTPServer def initialize(config) super @@ -111,6 +119,7 @@ module WEBrick proxy_port = proxy.port if proxy.userinfo credentials = "Basic " + [proxy.userinfo].pack("m*") header['proxy-authorization'] = credentials end end @@ -171,6 +180,7 @@ module WEBrick proxy_request_line = "CONNECT #{host}:#{port} HTTP/1.0" if proxy.userinfo credentials = "Basic " + [proxy.userinfo].pack("m*") end host, port = proxy.host, proxy.port end @@ -211,6 +221,10 @@ module WEBrick end res.send_response(ua) access_log(@config, req, res) end begin |