Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Doc/library/http.cookies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ in a cookie name (as :attr:`~Morsel.key`).
.. versionchanged:: 3.3
Allowed ':' as a valid cookie name character.

.. versionchanged:: next
Allowed '"' as a valid cookie value character.

.. note::

Expand Down Expand Up @@ -314,3 +316,10 @@ The following example demonstrates how to use the :mod:`http.cookies` module.
>>> print(C)
Set-Cookie: number=7
Set-Cookie: string=seven
>>> import json
>>> C = cookies.SimpleCookie()
>>> C.load(f'cookies=7; mixins="{json.dumps({"chips": "dark chocolate"})}"; state=gooey')
>>> print(C)
Set-Cookie: cookies=7
Set-Cookie: mixins="{"chips": "dark chocolate"}"
Set-Cookie: state="gooey"
8 changes: 8 additions & 0 deletions Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,14 @@ http.client
(Contributed by Alexander Enrique Urieles Nieto in :gh:`131724`.)


http.cookies
------------

* Allow ``"`` double quotes in cookie values with a more linient regex for
double-quoted strings.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we be more specific about what's changed than "a more lenient regex"? For example, do we now properly conform to an RFC/web specification? Are there restrictions that still exist on double-quoted strings?

Suggested change
* Allow ``"`` double quotes in cookie values with a more linient regex for
double-quoted strings.
* Allow '``"``' double quotes in cookie values with a more lenient regex for
double-quoted strings.

(Contributed by Nick Burns and Senthil Kumaran in :gh:`92936`.)


math
----

Expand Down
Loading