Project

General

Profile

Bug #244 ยป webrick.patch

tenderlovemaking (Aaron Patterson), 07/09/2008 11:55 AM

View differences:

lib/webrick/cookie.rb (working copy)
end
def self.parse_set_cookie(str)
cookie_elem = str.split(/;/)
cookie_elem = str.split(/;+/)
first_elem = cookie_elem.shift
first_elem.strip!
key, value = first_elem.split(/=/, 2)
test/webrick/test_cookie.rb (working copy)
assert_equal(true, cookie.secure)
end
def test_parse_set_cookie_extra_semicolon
data = %(WSIDC=WEST;; domain=.tenderlovemaking.com; path=/)
cookie = WEBrick::Cookie.parse_set_cookie(data)
assert_equal('WSIDC', cookie.name)
assert_equal('WEST', cookie.value)
assert_equal("/", cookie.path)
assert_equal(".tenderlovemaking.com", cookie.domain)
end
def test_parse_set_cookies
data = %(Shipping="FedEx"; Version="1"; Path="/acme"; Secure)
data << %(, CUSTOMER=WILE_E_COYOTE; path=/; expires=Wednesday, 09-Nov-99 23:12:40 GMT; path=/; Secure)
    (1-1/1)