Skip to content
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

Open
MarkusFalgenhauer opened this issue Dec 14, 2018 · 5 comments
Open

Multiple Tokens for requests with .retry() #108

MarkusFalgenhauer opened this issue Dec 14, 2018 · 5 comments

Comments

@MarkusFalgenhauer
Copy link

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?

@benbaran
Copy link
Owner

benbaran commented Dec 14, 2018 via email

@geerzo
Copy link
Collaborator

geerzo commented Dec 17, 2018

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.

@benbaran
Copy link
Owner

benbaran commented Dec 17, 2018 via email

@geerzo
Copy link
Collaborator

geerzo commented Dec 17, 2018

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?

@benbaran
Copy link
Owner

Looks like I was looking at an older version. I'm thinking you are right this may be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants