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: Form::text on wasm setting octet-stream mime type and file name. #2174

Merged
merged 1 commit into from
Mar 14, 2024
Merged

fix: Form::text on wasm setting octet-stream mime type and file name. #2174

merged 1 commit into from
Mar 14, 2024

Commits on Mar 13, 2024

  1. fix: Form::text on wasm setting octet-stream mime type and file name.

    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.
    ashdnazg committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    0c9f9fe View commit details
    Browse the repository at this point in the history