MCPcopy Index your code
hub / github.com/pathwaycom/pathway / __init__

Method __init__

python/pathway/io/http/_server.py:57–80  ·  view source on GitHub ↗
(self, request: web.Request, session_id: str)

Source from the content-addressed store, hash-verified

55
56class _LoggingContext:
57 def __init__(self, request: web.Request, session_id: str):
58 self.log = {
59 "_type": "http_access",
60 "method": request.method,
61 "scheme": request.scheme,
62 "scheme_with_forwarded": _request_scheme(request),
63 "host": request.host,
64 "route": str(request.rel_url),
65 "content_type": request.headers.get("Content-Type"),
66 "user_agent": request.headers.get("User-Agent"),
67 "unix_timestamp": int(time.time()),
68 "remote": request.remote,
69 "session_id": session_id,
70 }
71 headers = []
72 for header, value in request.headers.items():
73 headers.append(
74 {
75 "header": header,
76 "value": value,
77 }
78 )
79 self.log["headers"] = headers
80 self.request_start = time.time()
81
82 def log_response(self, status: int):
83 self.log["status"] = status

Callers

nothing calls this directly

Calls 3

_request_schemeFunction · 0.85
itemsMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected