refactoring cookies
This commit is contained in:
parent
d86ac5e3e0
commit
0c215685f2
|
@ -114,11 +114,10 @@ class Request(dict):
|
||||||
@property
|
@property
|
||||||
def cookies(self):
|
def cookies(self):
|
||||||
if self._cookies is None:
|
if self._cookies is None:
|
||||||
if 'cookie' in self.headers: #HTTP2 cookie header
|
cookie = self.headers.get('Cookie') or self.headers.get('cookie')
|
||||||
self.headers['Cookie'] = self.headers.pop('cookie')
|
if cookie is not None:
|
||||||
if 'Cookie' in self.headers:
|
|
||||||
cookies = SimpleCookie()
|
cookies = SimpleCookie()
|
||||||
cookies.load(self.headers['Cookie'])
|
cookies.load(cookie)
|
||||||
self._cookies = {name: cookie.value
|
self._cookies = {name: cookie.value
|
||||||
for name, cookie in cookies.items()}
|
for name, cookie in cookies.items()}
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user