Skip to content

Log User-Agent on each request - #9

Open
felipegaudio wants to merge 1 commit into
mainfrom
log-user-agent
Open

Log User-Agent on each request#9
felipegaudio wants to merge 1 commit into
mainfrom
log-user-agent

Conversation

@felipegaudio

Copy link
Copy Markdown
Contributor

Summary

  • Add a middleware that logs method, path, status, and User-Agent for every request
  • Motivation: we saw an unexplained HEAD /api/hello 404 in the access log and couldn't tell whether it came from Claude Code, opencode, or something else probing the exposed port

Test plan

  • pytest (83 passed)
  • Manual TestClient request confirms the log line includes user-agent

Helps identify which client (Claude Code, opencode, etc.) is hitting
unexpected paths like the observed HEAD /api/hello 404.

@oeslei Oeslei Kuhn (oeslei) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Não manjo de python e do framework usado. Parece ok.

Comment thread olist_code/server.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants