MCPcopy Create free account
hub / github.com/EasyIME/PIME / cookies

Method cookies

python/python3/tornado/httputil.py:387–407  ·  view source on GitHub ↗

A dictionary of ``http.cookies.Morsel`` objects.

(self)

Source from the content-addressed store, hash-verified

385
386 @property
387 def cookies(self) -> Dict[str, http.cookies.Morsel]:
388 """A dictionary of ``http.cookies.Morsel`` objects."""
389 if not hasattr(self, "_cookies"):
390 self._cookies = (
391 http.cookies.SimpleCookie()
392 ) # type: http.cookies.SimpleCookie
393 if "Cookie" in self.headers:
394 try:
395 parsed = parse_cookie(self.headers["Cookie"])
396 except Exception:
397 pass
398 else:
399 for k, v in parsed.items():
400 try:
401 self._cookies[k] = v
402 except Exception:
403 # SimpleCookie imposes some restrictions on keys;
404 # parse_cookie does not. Discard any cookies
405 # with disallowed keys.
406 pass
407 return self._cookies
408
409 def full_url(self) -> str:
410 """Reconstructs the full URL for this request."""

Callers

nothing calls this directly

Calls 2

parse_cookieFunction · 0.85
itemsMethod · 0.80

Tested by

no test coverage detected