]> granicus.if.org Git - python/commit
#16611: BaseCookie now parses 'secure' and 'httponly' flags.
authorR David Murray <rdmurray@bitdance.com>
Sun, 25 Aug 2013 15:09:02 +0000 (11:09 -0400)
committerR David Murray <rdmurray@bitdance.com>
Sun, 25 Aug 2013 15:09:02 +0000 (11:09 -0400)
commitcd0f74b1e09a50acc073aa57c1345968257a9056
tree7db89954d7f789c1c57048e300f7ae0c0405e720
parentf1fe15982287c5d026e8033b286533e867b51857
#16611: BaseCookie now parses 'secure' and 'httponly' flags.

Previously it generated them if they were given a value, but completely
ignored them if they were present in the string passed in to be parsed.  Now
if the flag appears on a cookie, the corresponding Morsel key will reference a
True value.  Other pre-existing behavior is retained in this maintenance
patch: if the source contains something like 'secure=foo', morsel['secure']
will return 'foo'.  Since such a value doesn't round trip and never did (and
would be a surprising occurrence) a subsequent non-bug-fix patch may change
this behavior.

Inspired by a patch from Julien Phalip, who reviewed this one.
Lib/http/cookies.py
Lib/test/test_http_cookies.py
Misc/NEWS