diff options
author | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-20 13:01:33 +0000 |
---|---|---|
committer | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-20 13:01:33 +0000 |
commit | a679f1861fc6ba25127433325e39d04e32c919c9 (patch) | |
tree | 0a9ea40ec26f9805d43a5e312718c4162916d0b5 /lib | |
parent | 07507fe37a01b461b5feb9f4c16dafe2f1276f28 (diff) | |
download | ruby-a679f1861fc6ba25127433325e39d04e32c919c9.tar.gz |
* lib/webrick/httprequest.rb (HTTPRequest#meta_vars): refine regexp.
* lib/webrick/cgi.rb (CGI#start): NPH scripts return status line
instead of Status: header field.
* lib/webrick/cgi.rb (CGI::Socket): refine some coditions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/webrick/cgi.rb | 20 | ||||
-rw-r--r-- | lib/webrick/httprequest.rb | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/lib/webrick/cgi.rb b/lib/webrick/cgi.rb index 464526d153..c4a5b1e934 100644 --- a/lib/webrick/cgi.rb +++ b/lib/webrick/cgi.rb @@ -37,11 +37,11 @@ module WEBrick sock = WEBrick::CGI::Socket.new(@config, env, stdin, stdout) req = HTTPRequest.new(@config) res = HTTPResponse.new(@config) - def res.setup_header - @header["status"] ||= @status - super - end unless @config[:NPH] + def res.setup_header + @header["status"] ||= @status + super + end def res.status_line "" end @@ -49,11 +49,11 @@ module WEBrick begin req.parse(sock) - req.script_name = (ENV["SCRIPT_NAME"] || "").dup - if ENV["PATH_INFO"].nil? || ENV["PATH_INFO"].empty? + req.script_name = (env["SCRIPT_NAME"] || "").dup + if env["PATH_INFO"].nil? || env["PATH_INFO"].empty? req.path_info = nil else - req.path_info = ENV["PATH_INFO"].dup + req.path_info = env["PATH_INFO"].dup end res.request_method = req.request_method res.request_uri = req.request_uri @@ -167,13 +167,13 @@ module WEBrick def cert if pem = @env["SSL_SERVER_CERT"] - OpenSSL::X509::Certificate.new(pem) if !pem.empty? + OpenSSL::X509::Certificate.new(pem) unless pem.empty? end end def peer_cert if pem = @env["SSL_CLIENT_CERT"] - OpenSSL::X509::Certificate.new(pem) if !pem.empty? + OpenSSL::X509::Certificate.new(pem) unless pem.empty? end end @@ -183,7 +183,7 @@ module WEBrick certs = keys.sort.collect{|k| if /^SSL_CLIENT_CERT_CHAIN_\d+$/ =~ k if pem = @env[k] - OpenSSL::X509::Certificate.new(pem) if !pem.empty? + OpenSSL::X509::Certificate.new(pem) unless pem.empty? end end } diff --git a/lib/webrick/httprequest.rb b/lib/webrick/httprequest.rb index 455e94c08c..8943a037ff 100644 --- a/lib/webrick/httprequest.rb +++ b/lib/webrick/httprequest.rb @@ -190,8 +190,8 @@ module WEBrick meta["SERVER_SOFTWARE"] = @config[:ServerSoftware].dup self.each{|key, val| - next if /content-type/ =~ key - next if /content-length/ =~ key + next if /^content-type$/i =~ key + next if /^content-length$/i =~ key name = "HTTP_" + key name.gsub!(/-/o, "_") name.upcase! |