feat(api): send a Seerr user agent on outbound requests - #3395
Conversation
Outbound HTTP calls went out with the default axios user agent, giving third-party services nothing to identify Seerr by. Add a request interceptor that sets a Seerr/<version> user agent, and register it the way the proxy interceptor is registered, on the default axios instance and on each axios.create() client. A user agent already set on the request is left alone, so webhook custom headers still win. Fixes seerr-team#3387
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe PR adds centralized ChangesUser-Agent propagation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change adds a Seerr user agent to outbound requests while preserving custom request headers, with no actionable merge-blocking risk remaining beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant ServerStartup
participant AxiosClient
participant userAgentRequestInterceptor
participant ExternalService
ServerStartup->>AxiosClient: Load User-Agent registration
AxiosClient->>userAgentRequestInterceptor: Process request config
userAgentRequestInterceptor->>ExternalService: Send Seerr/<version> when User-Agent is absent
userAgentRequestInterceptor-->>AxiosClient: Preserve custom User-Agent when provided
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Outbound HTTP calls went out with the default axios user agent, giving third-party services nothing to identify Seerr by.
Added a request interceptor that sets a Seerr/ user agent, and register it the way the proxy interceptor is registered, on the default axios instance and on each axios.create() client. A user agent already set on the request is left alone, so webhook custom headers still win.
How Has This Been Tested?
All new and existing tests passed. Environment ( macOS 26.5.2 arm64, Node 22.22.0, pnpm 10.24.0.)
Screenshots / Logs (if applicable)
not applicable to this case
Checklist:
pnpm buildpnpm i18n:extractI was asssited by Claude (Opus 5) in preparation of this PR, I have reviewed all changes and take full respoinsbility.
Summary by CodeRabbit
New Features
User-Agentheader.Bug Fixes
Tests