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

[fix] Content-Type undefined error #81

Merged
merged 2 commits into from
May 26, 2021
Merged

Conversation

EdvinasDaugirdas
Copy link
Contributor

Fixes:

  • An error being thrown when Content-Type header does not have a value

@@ -27,7 +27,7 @@ function boundary(spec, species) {
}

const headerValue = [...contentType].find((t) =>
t.value.includes('multipart/form-data')
(t.value || []).includes('multipart/form-data')
Copy link
Collaborator

@legander legander May 26, 2021

Choose a reason for hiding this comment

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

It would be preferred to default to the same data type as the check is ran on for clarity (even though includes is a method on both String and Array prototype). t.value || ""

@EdvinasDaugirdas EdvinasDaugirdas merged commit e5d1764 into master May 26, 2021
@EdvinasDaugirdas EdvinasDaugirdas deleted the fix/content-type-error branch May 26, 2021 13:10
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.

None yet

3 participants