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

User agent prefix #490

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

kenegozi
Copy link

Per the RFC at https://tools.ietf.org/html/rfc2616#section-14.43, "By convention, the product tokens are listed in order of their significance for identifying the application."

Support specifying a prefix to the user agent, so that a user could specify a more significant identifier for their requests.

kenegozi added 3 commits May 20, 2020 09:25
Per the RFC at https://tools.ietf.org/html/rfc2616#section-14.43, "By convention, the product tokens are listed in order of their significance for identifying the application."

Support specifying a prefix to the user agent, so that a user could specify a more significant identifier for their requests.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 20, 2020
@broady
Copy link
Contributor

broady commented May 20, 2020

It sounds like we should simply swap the order to match the spec. Also, some more ideas here: #494

@kenegozi
Copy link
Author

imo when setting a UserAgent field the expected behavior is to replace the user agent, not to append or prepend. Changing it in any way would be a breaking change though which is why I proposed a new field explicitly called UserAgentPrefix.

Interestingly enough, WithUserAgent() in NewService() would replace the agent, however it would not work with a custom http client provided via WithHttpClient.

A reasonable way forward (instead of the one proposed here) would be to mark UserAgent as obsolete, and have WithUserAgent work with a provided http client. I am happy to work on that change if preferred.

@codyoss codyoss added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 21, 2020
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 21, 2020
@googleapis googleapis deleted a comment from blackshipsail Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants