Skip to content
Myr

keep the double quotes, but don't escape them

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Flavio Curella · committed by Flavio Curella · parent cdab4fa · Browse files · 2 files+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+2 added−2 removed

  • other:+2 added−2 removed

2 files+2 added−2 removed

modified:requests/cookies.py+1 added-1 removed
259 unmodified lines
260 remove_cookie_by_name(self, name)261262 def set_cookie(self, cookie, *args, **kwargs):263 if cookie.value.startswith('"') and cookie.value.endswith('"'):264 cookie.value = cookie.value.strip('\\"')264 cookie.value = cookie.value.replace('\\"', '')265 return super(RequestsCookieJar, self).set_cookie(cookie, *args, **kwargs)266267 def update(self, other):268 """Updates this jar with cookies from another CookieJar or dict-like"""
131 unmodified lines
modified:test_requests.py+1 added-1 removed
171 unmodified lines
172173 def test_cookie_quote_wrapped(self):174 s = requests.session()175 s.get(httpbin('cookies/set?foo="bar:baz"'))176 self.assertTrue(s.cookies['foo'] == 'bar:baz')176 self.assertTrue(s.cookies['foo'] == '"bar:baz"')177178 def test_request_cookie_overrides_session_cookie(self):179 s = requests.session()180 s.cookies['foo'] = 'bar'
573 unmodified lines