-
Notifications
You must be signed in to change notification settings - Fork 41
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
Need to clear headers before retrying #11
Labels
bug
Something isn't working
Comments
I am having a similiar issue trying to change the account after setting it once.
|
@thejuan Thank you for this discovery and workaround! Here's my solution in TypeScript: import axios, { AxiosRequestConfig } from 'axios';
import { aws4Interceptor } from 'aws4-axios';
type Config = AxiosRequestConfig & { _originalHeaders?: AxiosRequestConfig['headers'] };
const axios = axios.create();
axios.interceptors.request.use((config: Config) => {
if (config._originalHeaders) {
config.headers = config._originalHeaders;
} else {
config._originalHeaders = config.headers;
}
return config;
});
const interceptor = aws4Interceptor({...});
axios.interceptors.request.use(interceptor); |
I fixed this in #1631 with a test. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In case this helps anyone else using this in conjunction with
axios-retry
requires resetting the headers before re-signing.I've added this after I add the aws4 interceptor.
The text was updated successfully, but these errors were encountered: