MCPcopy
hub / github.com/hugapi/hug / process_request

Method process_request

hug/middleware.py:81–90  ·  view source on GitHub ↗

Get session ID from cookie, load corresponding session data from coupled store and inject session data into the request context.

(self, request, response)

Source from the content-addressed store, hash-verified

79 return str(uuid.uuid4())
80
81 def process_request(self, request, response):
82 """Get session ID from cookie, load corresponding session data from coupled store and inject session data into
83 the request context.
84 """
85 sid = request.cookies.get(self.cookie_name, None)
86 data = {}
87 if sid is not None:
88 if self.store.exists(sid):
89 data = self.store.get(sid)
90 request.context.update({self.context_name: data})
91
92 def process_response(self, request, response, resource, req_succeeded):
93 """Save request context in coupled store object. Set cookie containing a session ID."""

Callers

nothing calls this directly

Calls 2

existsMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected