Skip to content
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

feat: add support for custom user agent #410

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jackwotherspoon
Copy link
Collaborator

Add support for custom user agent via user agent comments.

HTTP user agent's take the form of <product> / <product-version> <comment>

Previously, we did not allow support for the comment field, leaving no way
to customize a user agent:

userAgentDirectives: [
{
product: 'cloud-sql-nodejs-connector',
version: 'LIBRARY_SEMVER_VERSION',
},

This PR changes that by adding userAgent as a supported ConnectorOptions
which will be passed and used to set the comment field, allowing customizations
to the user agent.

Closes: #401
Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent

@jackwotherspoon jackwotherspoon self-assigned this Jan 3, 2025
@jackwotherspoon jackwotherspoon requested a review from a team as a code owner January 3, 2025 19:33
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.

Allow for custom user agents
1 participant