You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
Download the test-user-agent.ts file into a directory that has google-auth-library NPM package installed
Run ts-node test-user-agent.ts
Notice that the User-Agent sent in the request is google-api-nodejs-client/9.14.2
A clear and concise description of what the bug is, and what you expected to happen.
If you set the default request header User-Agent to foo/1 and you do not overwrite the User-Agent header in the per-request configuration then I would expect foo/1 to get sent out. When I say "per-request configuration" I mean like this:
Currently, what happens is this order of precedence:
The per-request User-Agent gets appended with google-api-nodejs-client/9.14.2. Example, if you pass bar/1 the User-Agent sent is bar/1 google-api-nodejs-client/9.14.2.
If you do not set per-request User-Agent then the User-Agent sent is google-api-nodejs-client/9.14.2.
If you have a default User-Agent set it will still be google-api-nodejs-client/9.14.2.
I expect the order of precedence to be:
No change. It's OK for the per-request User-Agent to be appended.
If you do not set per-request User-Agent then the default User-Agent should be used. It's OK for the default User-Agent to be appended.
If neither a per-request User-Agent nor a default User-Agent is set then the User-Agent is google-api-nodejs-client/9.14.2.
A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
I do not want to have to pass the User-Agent on every request call. I want to set the User-Agent as a default request header and that be respected by the library.
The text was updated successfully, but these errors were encountered:
Issue was opened with an invalid reproduction link. Please make sure the repository is a valid, publicly-accessible github repository, and make sure the url is complete (example: https://github.com/googleapis/google-cloud-node)
Please make sure you have searched for information in the following guides.
A screenshot that you have tested with "Try this API".
I could not find this package in the apis explorer.
Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.
https://gist.github.com/josephdpurcell/b434efc4870e4e7ba8387f9f7b98fd47
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
google-auth-library
NPM package installedts-node test-user-agent.ts
google-api-nodejs-client/9.14.2
A clear and concise description of what the bug is, and what you expected to happen.
If you set the default request header User-Agent to
foo/1
and you do not overwrite the User-Agent header in the per-request configuration then I would expectfoo/1
to get sent out. When I say "per-request configuration" I mean like this:Currently, what happens is this order of precedence:
google-api-nodejs-client/9.14.2
. Example, if you passbar/1
the User-Agent sent isbar/1 google-api-nodejs-client/9.14.2
.google-api-nodejs-client/9.14.2
.google-api-nodejs-client/9.14.2
.I expect the order of precedence to be:
google-api-nodejs-client/9.14.2
.A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
I do not want to have to pass the User-Agent on every request call. I want to set the User-Agent as a default request header and that be respected by the library.
The text was updated successfully, but these errors were encountered: