refactoring cookies

This commit is contained in:
Jack Fischer 2016-11-27 08:30:46 -05:00
parent d86ac5e3e0
commit 0c215685f2

View File

@ -114,11 +114,10 @@ class Request(dict):
@property
def cookies(self):
if self._cookies is None:
if 'cookie' in self.headers: #HTTP2 cookie header
self.headers['Cookie'] = self.headers.pop('cookie')
if 'Cookie' in self.headers:
cookie = self.headers.get('Cookie') or self.headers.get('cookie')
if cookie is not None:
cookies = SimpleCookie()
cookies.load(self.headers['Cookie'])
cookies.load(cookie)
self._cookies = {name: cookie.value
for name, cookie in cookies.items()}
else: