mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-03 04:14:43 +00:00
Detect invalid empty cookies.
This commit is contained in:
parent
d0fbe8b7f6
commit
1a28c2e334
3 changed files with 15 additions and 0 deletions
|
|
@ -1,5 +1,10 @@
|
|||
7.7 "Intouchables" (released xx.xx.2012)
|
||||
|
||||
Fixes:
|
||||
- checking: Detect invalid empty cookie values.
|
||||
Patch by Charles Jones.
|
||||
Closes: SF bug #3514219
|
||||
|
||||
|
||||
7.6 "Türkisch für Anfänger" (released 31.03.2012)
|
||||
|
||||
|
|
|
|||
|
|
@ -252,6 +252,8 @@ class HttpCookie (object):
|
|||
if key.startswith("$"):
|
||||
key = key[1:]
|
||||
self.set_attribute(key, value)
|
||||
if self.name is None:
|
||||
raise CookieError("missing cookie name in %r" % text)
|
||||
self.calculate_expiration()
|
||||
|
||||
def set_default_attributes (self, scheme, host, path):
|
||||
|
|
|
|||
|
|
@ -143,6 +143,14 @@ class TestCookies (unittest.TestCase):
|
|||
self.assertNotEqual(cookie1, cookie3)
|
||||
self.assertNotEqual(cookie2, cookie3)
|
||||
|
||||
def test_netscape_cookie8 (self):
|
||||
value = ""
|
||||
scheme = "http"
|
||||
host = "localhost"
|
||||
path = "/"
|
||||
self.assertRaises(linkcheck.cookies.CookieError,
|
||||
linkcheck.cookies.NetscapeCookie, value, scheme, host, path)
|
||||
|
||||
def test_rfc_cookie1 (self):
|
||||
data = (
|
||||
("Foo", "Bar"),
|
||||
|
|
|
|||
Loading…
Reference in a new issue