Skip to content

Commit

Permalink
do not turn cookie key to bytes in py3
Browse files Browse the repository at this point in the history
  • Loading branch information
pbauer committed Apr 2, 2018
1 parent d643b3b commit 47e5ae0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ZPublisher/HTTPResponse.py
Expand Up @@ -265,7 +265,7 @@ def setCookie(self, name, value, quoted=True, **kw):
This value overwrites any previously set value for the
cookie in the Response object.
"""
if isinstance(name, text_type):
if PY2 and isinstance(name, text_type):
name = name.encode(self.charset)
if isinstance(value, text_type):
value = value.encode(self.charset)
Expand All @@ -288,7 +288,7 @@ def appendCookie(self, name, value):
cookie has previously been set in the response object, the new
value is appended to the old one separated by a colon.
"""
if isinstance(name, text_type):
if PY2 and isinstance(name, text_type):
name = name.encode(self.charset)
if isinstance(value, text_type):
value = value.encode(self.charset)
Expand All @@ -314,7 +314,7 @@ def expireCookie(self, name, **kw):
when creating the cookie. The path can be specified as a keyword
argument.
"""
if isinstance(name, text_type):
if PY2 and isinstance(name, text_type):
name = name.encode(self.charset)

d = kw.copy()
Expand Down

0 comments on commit 47e5ae0

Please sign in to comment.