Closed josephdpurcell closed 2 hours ago
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)
Not sure why this was closed. I linked to a public gist, which the instructions say is acceptable.
https://github.com/googleapis/google-auth-library-nodejs/issues/1489#issuecomment-1331404312 is a workaround that can be used. I have a variation here that uses the default https://gist.github.com/josephdpurcell/b434efc4870e4e7ba8387f9f7b98fd47#file-workaround-ts.
I suppose at least this issue is documented for the next person.
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.