superfaceai / one-sdk-js

1️⃣ One Node.js SDK for all the APIs you want to integrate with
https://superface.ai
MIT License
46 stars 3 forks source link

fix(http): Don't set content-type w/ form-data #231

Closed jnv closed 2 years ago

jnv commented 2 years ago

Description

Related to #230 (but not root cause).

When I want to send body with multipart/form-data encoding to Mailgun, I am getting back server error "Missing content boundary". Upon closer inspection, the boundary directive is missing in the Content-Type header. It is normally automatically read from FormData, but since content-type is set explicitly, it's not overwritten.

Thanks to @lukas-valenta for helping me to solve this issue.

Motivation and Context

Types of changes

Checklist:

jnv commented 2 years ago

@lukas-valenta I have recreated the PR post-release, as discussed.