-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
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
Multiple Tokens for requests with .retry() #108
Comments
Yeah, this is definitely a bug. The intercepter needs to be modified to replace the header instead of appending to it. I’m out of town, but will take a look when I get back.
Or if you or anyone else wants to take a crack at it, I’ll gladly accept the contribution: )
…Sent from my iPhone
On Dec 14, 2018, at 2:48 AM, Markus Falgenhauer ***@***.***> wrote:
Hi,
I am still on angular4 Version 1.1.11 but i think this will also affect newer Versions.
When i do a .retry() on the http request, with every retry a Bearer token is added to the Authorization Header.
So: first call is correct, second has: Authorization: Bearer ey......., Bearer ey.... in the header and so on, which leads to Unauthorized.
Is there a quick solution to avoid this behavior?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I think this issue is fixed in the latest code as it uses "headers.set" which should replace, not append. There was a time earlier this year where it was append though. |
I was able to reproduce. Maybe “set” doesn’t work as expected?
…Sent from my iPhone
On Dec 16, 2018, at 7:30 PM, Chris Geer ***@***.***> wrote:
I think this issue is fixed in the latest code as it uses "headers.set" which should replace, not append. There was a time earlier this year where it was append though.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
That is possible, or it's a complication with using clone at the same time? Docs seem to state it should work. Wonder if there is a bug in certain angular versions? https://angular.io/api/http/Headers#set I remember having this problem before but once it was changed from append to set it started working as designed (again, latest code, not 1.1.11). @benbaran do you have sample code you used to reproduce? |
Looks like I was looking at an older version. I'm thinking you are right this may be fixed. |
Hi,
I am still on angular4 Version 1.1.11 but i think this will also affect newer Versions.
When i do a .retry() on the http request, with every retry a Bearer token is added to the Authorization Header.
So: first call is correct, second has: Authorization: Bearer ey......., Bearer ey.... in the header and so on, which leads to Unauthorized.
Is there a quick solution to avoid this behavior?
The text was updated successfully, but these errors were encountered: