mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
22088e3423
commit
d27c31e041
2 changed files with 11 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
Wed May 28 16:12:44 2008 Akinori MUSHA <knu@iDaemons.org>
|
||||
|
||||
* 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:53:52 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* enc/trans/japanese.c (to_SHIFT_JIS_EF_infos): typo.
|
||||
|
|
|
@ -87,6 +87,10 @@ module WEBrick
|
|||
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)
|
||||
|
|
Loading…
Add table
Reference in a new issue