Skip to content

Conversation

kuu12
Copy link

@kuu12 kuu12 commented Oct 24, 2022

Comment on lines +121 to +128
// Fix bug https://stackoverflow.com/questions/39280438/fetch-missing-boundary-in-multipart-form-data-post
if (config.data instanceof FormData && config.headers) {
const ContentType = 'Content-Type';
delete config.headers[ContentType];
delete config.headers[ContentType.toLowerCase()];
delete config.headers[ContentType.toUpperCase()];
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this. There's code to do it later in the code. Your use case seems similar to mine, which is run axios on a ServiceWorker. I think we just need to fix the condition in the code a little bit below to make sure it enters there. It's not entering the if condition in case of ServiceWorkers because isStandardBrowserEnv is returning false as ServiceWorkers don't have access to window nor document.

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

Successfully merging this pull request may close these issues.

2 participants