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
I started having "The header content contains invalid characters" exception being thrown. When doing an OAuth request, the error callback is being called with the error, but also an exception is being thrown.
I think it might be related to some recent changes in Node.JS HTTP module being more strict about HTTP headers.
This is probably due to remote end having some invalid headers, but it's not very convenient to have the exception thrown and the error should probably be handled in the callback.
After further investigation it turned out access_token was undefined in my oauth.get() call, which caused the exception to be thrown. Properly passing access_token and the exception goes away.
Hi,
I started having "The header content contains invalid characters" exception being thrown. When doing an OAuth request, the error callback is being called with the error, but also an exception is being thrown.
I think it might be related to some recent changes in Node.JS HTTP module being more strict about HTTP headers.
This is probably due to remote end having some invalid headers, but it's not very convenient to have the exception thrown and the error should probably be handled in the callback.
I think we need to wrap the request call in try/catch block here: https://github.com/ciaranj/node-oauth/blob/master/lib/oauth2.js#L132
Similar to request/request#2164
Node.Js 4.4.0
node-oauth 0.9.14
The text was updated successfully, but these errors were encountered: