ruby-changes:5168
From: knu <ko1@a...>
Date: Wed, 28 May 2008 16:16:03 +0900 (JST)
Subject: [ruby-changes:5168] Ruby:r16663 (ruby_1_8): * lib/webrick/httpservlet/cgihandler.rb (WEBrick::HTTPServlet::CGIHandler#do_GET):
knu 2008-05-28 16:15:52 +0900 (Wed, 28 May 2008)
New Revision: 16663
Modified files:
branches/ruby_1_8/ChangeLog
branches/ruby_1_8/lib/webrick/httpservlet/cgihandler.rb
Log:
* lib/webrick/httpservlet/cgihandler.rb (WEBrick::HTTPServlet::CGIHandler#do_GET):
Set the HTTP status code to 302 if a Location header field is
present and the status code is not valid as a client
redirection. cf. RFC 3875 6.2.3, 6.2.4.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=16663&r2=16662&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/lib/webrick/httpservlet/cgihandler.rb?r1=16663&r2=16662&diff_format=u
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog (revision 16662)
+++ ruby_1_8/ChangeLog (revision 16663)
@@ -1,3 +1,10 @@
+Wed May 28 16:12:44 2008 Akinori MUSHA <knu@i...>
+
+ * lib/webrick/httpservlet/cgihandler.rb (WEBrick::HTTPServlet::CGIHandler#do_GET):
+ Set the HTTP status code to 302 if a Location header field is
+ present and the status code is not valid as a client
+ redirection. cf. RFC 3875 6.2.3, 6.2.4.
+
Wed May 28 15:18:16 2008 Nobuyoshi Nakada <nobu@r...>
* lib/singleton.rb (SingletonClassMethods): _load should be public.
Index: ruby_1_8/lib/webrick/httpservlet/cgihandler.rb
===================================================================
--- ruby_1_8/lib/webrick/httpservlet/cgihandler.rb (revision 16662)
+++ ruby_1_8/lib/webrick/httpservlet/cgihandler.rb (revision 16663)
@@ -85,6 +85,10 @@
res.status = $1.to_i
header.delete('status')
end
+ if header.has_key?('location')
+ # RFC 3875 6.2.3, 6.2.4
+ res.status = 302 unless (300...400) === res.status
+ end
if header.has_key?('set-cookie')
header['set-cookie'].each{|k|
res.cookies << Cookie.parse_set_cookie(k)
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/