feat: add --user-agent flag for full User-Agent override#2035
Open
tmchow wants to merge 1 commit intolightpanda-io:mainfrom
Open
feat: add --user-agent flag for full User-Agent override#2035tmchow wants to merge 1 commit intolightpanda-io:mainfrom
tmchow wants to merge 1 commit intolightpanda-io:mainfrom
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
Contributor
Author
|
recheck |
When --user-agent is set, the provided string replaces the entire User-Agent header instead of appending to "Lightpanda/1.0". The existing --user-agent-suffix behavior is unchanged. Fixes lightpanda-io#2029
6360383 to
89aa3ba
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
--user-agentCLI flag that replaces the entire User-Agent header. When set, the provided string is used as-is instead of the defaultLightpanda/1.0prefix.This addresses users migrating from Chrome headless who need full UA control. The existing
--user-agent-suffixbehavior is unchanged.The change is in
Config.zig:user_agentfield inCommonoptionsuserAgent()accessor (same pattern asuserAgentSuffix())HttpHeaders.initchecksuserAgent()first, falls back to suffix, then default--user-agent/--user_agentThe CDP
Emulation.setUserAgentOverridecommand is still stubbed. Wiring a runtime UA override through the CDP session to the HTTP layer is a larger change that could follow separately.This contribution was developed with AI assistance (Claude Code).
Fixes #2029