diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2018-04-22 23:48:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-22 23:48:11 (GMT) |
commit | d5a2377c3d70e4143bcbee4a765b3434e21f683a (patch) | |
tree | fb88557cdcf43ba46a8c2e889f2beed603970947 /Lib/http | |
parent | b81ca28b378c8b29204a37f8bd433a3379f53f7d (diff) | |
download | cpython-d5a2377c3d70e4143bcbee4a765b3434e21f683a.zip cpython-d5a2377c3d70e4143bcbee4a765b3434e21f683a.tar.gz cpython-d5a2377c3d70e4143bcbee4a765b3434e21f683a.tar.bz2 |
bpo-991266: Fix quoting of Comment attribute of SimpleCookie (GH-6555)
Diffstat (limited to 'Lib/http')
-rw-r--r-- | Lib/http/cookies.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py index b2e995c..6694f54 100644 --- a/Lib/http/cookies.py +++ b/Lib/http/cookies.py @@ -408,6 +408,8 @@ class Morsel(dict): append("%s=%s" % (self._reserved[key], _getdate(value))) elif key == "max-age" and isinstance(value, int): append("%s=%d" % (self._reserved[key], value)) + elif key == "comment" and isinstance(value, str): + append("%s=%s" % (self._reserved[key], _quote(value))) elif key in self._flags: if value: append(str(self._reserved[key])) |