Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/mavedb/lib/logging/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ async def set_context(self, request: Union[Request, HTTPConnection]) -> dict:
ctx: dict[str, Any] = {}

ctx["request_ns"] = time.time_ns()
ctx["path"] = request.url.path
# The ASGI scope rather than request.url.path, which truncates at a '#'. Starlette builds
# request.url by re-parsing, so a variant URN's '#' opens a fragment there and the variant
# number and sub-resource are dropped: three /variants routes all logged the same path.
ctx["path"] = request.scope["path"]

if isinstance(request, Request):
ctx["method"] = request.method
Expand Down
Loading