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
On some requests I need to pass headers, but not others. I have a generic method for doing POST requests so sometimes headers is undefined and it seems the Authorization header is removed:
api.headers(headers)
I've resorted to doing this:
api.headers(headers||{})
It works, but it doesn't seem like .headers() should be messing with the auth header set with .auth(), no?
The text was updated successfully, but these errors were encountered:
It works, but it doesn't seem like .headers() should be messing with the auth header set with .auth(), no?
Indeed this is an issue, thanks for the report! Passing null or undefined as an argument to .headers() should not mess with the headers that were previously set.
I just released the 1.5.3 which contains the fix 👍.
I set the auth header like this which works fine:
On some requests I need to pass headers, but not others. I have a generic method for doing POST requests so sometimes
headers
is undefined and it seems theAuthorization
header is removed:I've resorted to doing this:
It works, but it doesn't seem like
.headers()
should be messing with the auth header set with.auth()
, no?The text was updated successfully, but these errors were encountered: