[New-bugs-announce] [issue27674] Quote mark breaks cookie processing
Artur Smęt
report at bugs.python.org
Wed Aug 3 08:22:28 EDT 2016
New submission from Artur Smęt:
The problem is similar to https://bugs.python.org/issue22931 with square brackets in cookie values.
Incorrect value is serialized JSON in this case, for example:
>>> from Cookie import SimpleCookie
>>> cookie = SimpleCookie()
>>> cookie.load('a=b; c={"somekey":"value"}; d=e, f=g, some=other')
>>> cookie.output()
'Set-Cookie: a=b'
>>>
>From my tests I figured out that quote mark (") is causing problems.
In fact, according to HTTP specification, cookies can't be JSON objects, but I think that python library shouldn't silently allow incorrect values. Probably incorrect cookies should be skipped, or some exception should be thrown there.
----------
components: Library (Lib)
messages: 271901
nosy: Artur Smęt
priority: normal
severity: normal
status: open
title: Quote mark breaks cookie processing
type: behavior
versions: Python 2.7
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27674>
_______________________________________
More information about the New-bugs-announce
mailing list