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

feat: use AbortController, fix multipart boundary #21

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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