Skip to content

Commit

Permalink
keep the double quotes, but don't escape them
Browse files Browse the repository at this point in the history
  • Loading branch information
fcurella committed Jul 1, 2013
1 parent cdab4fa commit a8cf5b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion requests/cookies.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def __delitem__(self, name):

def set_cookie(self, cookie, *args, **kwargs):
if cookie.value.startswith('"') and cookie.value.endswith('"'):
cookie.value = cookie.value.strip('\\"')
cookie.value = cookie.value.replace('\\"', '')
return super(RequestsCookieJar, self).set_cookie(cookie, *args, **kwargs)

def update(self, other):
Expand Down
2 changes: 1 addition & 1 deletion test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def test_cookie_removed_on_expire(self):
def test_cookie_quote_wrapped(self):
s = requests.session()
s.get(httpbin('cookies/set?foo="bar:baz"'))
self.assertTrue(s.cookies['foo'] == 'bar:baz')
self.assertTrue(s.cookies['foo'] == '"bar:baz"')

def test_request_cookie_overrides_session_cookie(self):
s = requests.session()
Expand Down

0 comments on commit a8cf5b8

Please sign in to comment.