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

beforeRequest hook called after beforeRetry #500

Open
hamdiwanis opened this issue Apr 16, 2023 · 3 comments
Open

beforeRequest hook called after beforeRetry #500

hamdiwanis opened this issue Apr 16, 2023 · 3 comments

Comments

@hamdiwanis
Copy link

Please verify if this is the correct flow or not I was not expecting "beforeRequest "to be called again after "beforeRetry", my use case is that I refresh the token and set the Authorization header in "beforeRetry "but it gets overridden by "beforeRequest".

thanks in advance.

@sindresorhus
Copy link
Owner

I think this is expected behavior. It's called for every single request with no exception. A retry is a request. We should clearly point that out in the docs, however.

Maybe the request could somehow indicate that it's a request caused by a retry.

@hamdiwanis
Copy link
Author

Got it thanks for your response

@sindresorhus
Copy link
Owner

No need to close. There are unresolved tasks here.

@sindresorhus sindresorhus reopened this Apr 20, 2023
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

2 participants