We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
with the change from request to axios, the outgoing requests have now 2 user agent headers:
request
axios
'User-agent': 'sendgrid/7.0.0;nodejs'
'User-Agent': 'axios/0.19.2'
this makes our testing with nock fail, because it tries to lower-case all headers and breaks when there is a conflict.
nock
sendgrid adds the user agent header with uppercase "U" and lowercase "a"
sendgrid-nodejs/packages/client/src/classes/client.js
Line 23 in ae1148c
but axios just checks for the header with "u" + "a" or "U" + "A" https://github.com/axios/axios/blob/42eb9dfabc85ed029462da1c503f8b414b08ffd0/lib/adapters/http.js#L34
if (!headers['User-Agent'] && !headers['user-agent']) {
the resulting request has both headers:
headers: { Accept: 'application/json', 'Content-Type': 'application/json', 'User-agent': 'sendgrid/7.0.0;nodejs', Authorization: 'Bearer SG.fakeKey', 'User-Agent': 'axios/0.19.2', 'Content-Length': 360 }
The text was updated successfully, but these errors were encountered:
Nice catch. PR submitted.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Issue Summary
with the change from
request
toaxios
, the outgoing requests have now 2 user agent headers:'User-agent': 'sendgrid/7.0.0;nodejs'
'User-Agent': 'axios/0.19.2'
this makes our testing with
nock
fail, because it tries to lower-case all headers and breaks when there is a conflict.Steps to Reproduce
Code Snippet
sendgrid adds the user agent header with uppercase "U" and lowercase "a"
sendgrid-nodejs/packages/client/src/classes/client.js
Line 23 in ae1148c
but axios just checks for the header with "u" + "a" or "U" + "A"
https://github.com/axios/axios/blob/42eb9dfabc85ed029462da1c503f8b414b08ffd0/lib/adapters/http.js#L34
Exception/Log
the resulting request has both headers:
Technical details:
The text was updated successfully, but these errors were encountered: