-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(wasm) fix: Form::text on wasm setting octet-stream mime type and fil…
…e name. (#2174) Unfortunately JS's fetch API is somewhat limited and only supports two options for multipart form data parts: 1) String with no file name and no mime type (which should be interpreted as text/plain). 2) Blob with a file name ("blob" if not provided by the user) and a mime type if provided by the user. Until this commit, reqwest always used the latter option, so when a user tried to add a text part with no file name, it would be sent with a mime type of `application/octet-stream` and the filename "blob". While we can't make the behaviour identical to the native implementation, we can do a best-effort approach, using option (1) as long as the user hasn't set a file name or a non plain text mime type.
- Loading branch information
Showing
2 changed files
with
121 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters