MCPcopy Create free account
hub / github.com/apify/crawlee-python / get_cookies_from_headers

Function get_cookies_from_headers

tests/unit/server.py:60–68  ·  view source on GitHub ↗

Extract cookies from request headers.

(headers: dict[str, Any])

Source from the content-addressed store, hash-verified

58
59
60def get_cookies_from_headers(headers: dict[str, Any]) -> dict[str, str]:
61 """Extract cookies from request headers."""
62 cookies = {}
63 cookie_header: str = headers.get('cookie', '')
64 if cookie_header:
65 for cookie in cookie_header.split(';'):
66 name, value = cookie.strip().split('=')
67 cookies[name] = value
68 return cookies
69
70
71async def send_json_response(send: Send, data: Any, status: int = 200) -> None:

Callers 1

get_cookiesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected