var realHeaders= {};
for( var key in this._customHeaders ) {
realHeaders[key]= this._customHeaders[key];
}
I took a picture of my Watch window while debugging this, and we can see that realHeaders got the function clean from the prototype of this._customHeaders:
Here's my full stack trace (my local paths are redacted):
error: TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["clean"]
at ClientRequest.setHeader (node:_http_outgoing:578:3)
at new ClientRequest (node:_http_client:266:14)
at Object.request (node:https:333:10)
at exports.OAuth2._executeRequest (...\node_modules\oauth\lib\oauth2.js:146:30)
at exports.OAuth2._request (...\node_modules\oauth\lib\oauth2.js:120:8)
at exports.OAuth2.getOAuthAccessToken (...\node_modules\oauth\lib\oauth2.js:190:8)
at loaded (...\node_modules\passport-oauth2\lib\strategy.js:175:20)
at NullStore.verify (...\node_modules\passport-oauth2\lib\state\null.js:9:3)
at Strategy.OAuth2Strategy.authenticate (...\node_modules\passport-oauth2\lib\strategy.js:222:26)
at attempt (...\node_modules\passport\lib\middleware\authenticate.js:369:16)
error: $GET /api/auth/stack-exchange/callback?code=...)) 500 - 10.371 ms - message: Invalid character in header content ["clean"]
Have I done anything wrong, or should this be fixed?
I'm using
node-oauth
through other third party library (passport), and get the following error:This is caused by this code block in
oauth2js
:I took a picture of my Watch window while debugging this, and we can see that
realHeaders
got the functionclean
from the prototype ofthis._customHeaders
:Here's my full stack trace (my local paths are redacted):
Have I done anything wrong, or should this be fixed?