-
Notifications
You must be signed in to change notification settings - Fork 30
fix: set canonical User-Agent header format #643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -167,7 +167,7 @@ def _build_headers( | |||||
| ) -> Dict[str, str]: | ||||||
| headers: Dict[str, str] = { | ||||||
| "Content-Type": "application/json", | ||||||
| "User-Agent": f"workos-python/{VERSION} python/{platform.python_version()}", | ||||||
| "User-Agent": f"WorkOS Python/{platform.python_version()} Python SDK/{VERSION}", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π΄ User-Agent header has SDK version and Python runtime version swapped The new User-Agent string
Suggested change
Was this helpful? React with π or π to provide feedback. |
||||||
| } | ||||||
| if self._api_key: | ||||||
| headers["Authorization"] = f"Bearer {self._api_key}" | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing test suite has no assertion that verifies the exact string set in the
User-Agentheader. Since this PR was created specifically to restore a previously-broken header value, a dedicated test would prevent the same regression from silently reappearing in a future refactor of_build_headers.