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): the value of Set-Cookie: header field should be splited into each cookie. [ruby-Bugs:2199] * lib/webrick/cookie.rb (WEBrick::Cookie.parse_set_cookie): new method to parse the value of Set-Cookie: header field. * test/webrick/test_cookie.rb, test/webrick/test_cgi.rb, test/webrick/webrick.cgi: add some test for cookie. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8ffc757310
commit
aa57e68b06
6 changed files with 87 additions and 0 deletions
|
@ -85,6 +85,12 @@ module WEBrick
|
|||
res.status = $1.to_i
|
||||
header.delete('status')
|
||||
end
|
||||
if header.has_key?('set-cookie')
|
||||
header['set-cookie'].each{|k|
|
||||
res.cookies << Cookie.parse_set_cookie(k)
|
||||
}
|
||||
header.delete('set-cookie')
|
||||
end
|
||||
header.each{|key, val| res[key] = val.join(", ") }
|
||||
rescue => ex
|
||||
raise HTTPStatus::InternalServerError, ex.message
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue