1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
gotoyuzo 2003-12-20 13:01:33 +00:00
parent 07507fe37a
commit a679f1861f
3 changed files with 22 additions and 13 deletions

View file

@ -1,3 +1,12 @@
Sat Dec 20 21:59:03 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
* 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.
Sat Dec 20 16:07:14 2003 Nobuyoshi Nakada <nobu@ruby-lang.org> Sat Dec 20 16:07:14 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/optparse.rb (OptionParser::Completion::complete): wrong * lib/optparse.rb (OptionParser::Completion::complete): wrong
@ -26,7 +35,7 @@ Sat Dec 20 02:18:31 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
Fri Dec 19 21:24:22 2003 GOTOU Yuuzou <gotoyuzo@notwork.org> Fri Dec 19 21:24:22 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/httprequest.rb (meta_vers): should not set * lib/webrick/httprequest.rb (HTTPRequest#meta_vars): should not set
HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH. HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH.
* lib/webrick/https.rb (HTTPRequest#parse): should check presence * lib/webrick/https.rb (HTTPRequest#parse): should check presence

View file

@ -37,11 +37,11 @@ module WEBrick
sock = WEBrick::CGI::Socket.new(@config, env, stdin, stdout) sock = WEBrick::CGI::Socket.new(@config, env, stdin, stdout)
req = HTTPRequest.new(@config) req = HTTPRequest.new(@config)
res = HTTPResponse.new(@config) res = HTTPResponse.new(@config)
def res.setup_header
@header["status"] ||= @status
super
end
unless @config[:NPH] unless @config[:NPH]
def res.setup_header
@header["status"] ||= @status
super
end
def res.status_line def res.status_line
"" ""
end end
@ -49,11 +49,11 @@ module WEBrick
begin begin
req.parse(sock) req.parse(sock)
req.script_name = (ENV["SCRIPT_NAME"] || "").dup req.script_name = (env["SCRIPT_NAME"] || "").dup
if ENV["PATH_INFO"].nil? || ENV["PATH_INFO"].empty? if env["PATH_INFO"].nil? || env["PATH_INFO"].empty?
req.path_info = nil req.path_info = nil
else else
req.path_info = ENV["PATH_INFO"].dup req.path_info = env["PATH_INFO"].dup
end end
res.request_method = req.request_method res.request_method = req.request_method
res.request_uri = req.request_uri res.request_uri = req.request_uri
@ -167,13 +167,13 @@ module WEBrick
def cert def cert
if pem = @env["SSL_SERVER_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
end end
def peer_cert def peer_cert
if pem = @env["SSL_CLIENT_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
end end
@ -183,7 +183,7 @@ module WEBrick
certs = keys.sort.collect{|k| certs = keys.sort.collect{|k|
if /^SSL_CLIENT_CERT_CHAIN_\d+$/ =~ k if /^SSL_CLIENT_CERT_CHAIN_\d+$/ =~ k
if pem = @env[k] if pem = @env[k]
OpenSSL::X509::Certificate.new(pem) if !pem.empty? OpenSSL::X509::Certificate.new(pem) unless pem.empty?
end end
end end
} }

View file

@ -190,8 +190,8 @@ module WEBrick
meta["SERVER_SOFTWARE"] = @config[:ServerSoftware].dup meta["SERVER_SOFTWARE"] = @config[:ServerSoftware].dup
self.each{|key, val| self.each{|key, val|
next if /content-type/ =~ key next if /^content-type$/i =~ key
next if /content-length/ =~ key next if /^content-length$/i =~ key
name = "HTTP_" + key name = "HTTP_" + key
name.gsub!(/-/o, "_") name.gsub!(/-/o, "_")
name.upcase! name.upcase!