refactor: update User-Agent and architecture in headers, enhance fingerprint handling in account test service#1328
Open
b2r66sun wants to merge 9 commits intoWei-Shaw:mainfrom
Open
refactor: update User-Agent and architecture in headers, enhance fingerprint handling in account test service#1328b2r66sun wants to merge 9 commits intoWei-Shaw:mainfrom
b2r66sun wants to merge 9 commits intoWei-Shaw:mainfrom
Conversation
b2r66sun
commented
Mar 26, 2026
- Updated User-Agent to "claude-cli/2.1.84" and architecture to "x64" in constants.
- Enhanced fingerprint handling in the AccountTestService to utilize user agent from the fingerprint if available.
- Added tests to ensure correct payload creation with updated headers and fingerprint data.
- Adjusted session string generation to accept user agent as a parameter for consistency.
…erprint handling in account test service - Updated User-Agent to "claude-cli/2.1.84" and architecture to "x64" in constants. - Enhanced fingerprint handling in the AccountTestService to utilize user agent from the fingerprint if available. - Added tests to ensure correct payload creation with updated headers and fingerprint data. - Adjusted session string generation to accept user agent as a parameter for consistency.
- Added `github.com/google/subcommands v1.2.0` and `golang.org/x/tools v0.41.0` to `go.mod`. - Updated `go.sum` to reflect new dependencies. - Refactored service initialization in `wire_gen.go` to improve clarity and organization, including the addition of new services like `NewSoraGenerationService` and `NewSoraQuotaService`. - Removed unused variables and streamlined handler registrations in `wire.go` files.
- Updated the OAuth client to use separate factories for browser and token clients. - Introduced new request headers for browser authorization and token requests to ensure proper handling. - Improved test coverage by capturing and validating headers in OAuth service tests. - Refactored header setting in usage service to maintain wire casing for HTTP requests.ols/
…onization - Introduced the X-Claude-Code-Session-Id header to the allowed headers list. - Implemented synchronization of the X-Claude-Code-Session-Id header with the session_id from metadata.user_id in both buildUpstreamRequest and buildCountTokensRequest functions. - Ensured consistent handling of session_id when masking is enabled or disabled.
- Removed content-type header for GET requests to align with CLI behavior. - Added new headers: anthropic-dangerous-direct-browser-access and x-app for improved request handling. - Ensured request headers maintain wire casing for consistency.
…ieval - Added a new endpoint to retrieve the identity fingerprint for an account. - Updated the AccountHandler to include identityCache for managing identity fingerprints. - Modified related tests to accommodate the new identity fingerprint functionality. - Ensured consistent handling of headers and request structure in the updated routes.
…efaults - Enhanced the newOrderedH2Transport function to include HTTP/2 SETTINGS configuration. - Set HeaderTableSize, InitialWindowSize, and other settings to align with nghttp2 client defaults. - Updated SETTINGS frame field order for consistency with nghttp2 specifications. - Maintained existing ReadIdleTimeout and PingTimeout settings.
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.