Skip to content

multipart/form-data uploads are unparseable (missing boundary, truncated body) #163

Description

@Noethix55555

Sending a request with -F/file fields (multipart content type) produces a body that servers reject with:

no multipart boundary param in Content-Type

Two issues in the multipart branch of SubmitRequest:

  1. The Content-Type header is sent as the literal string multipart/form-data with no boundary parameter (config.ContentTypes maps multipart to multipart/form-data). Servers cannot parse a multipart body without the boundary.

  2. multiWriter.Close() is deferred, so it runs only after the body buffer has already been captured via bytes.NewReader(bodyBytes.Bytes()) and sent. The terminating boundary is never written, so the body is also truncated.

Result: every multipart upload body is rejected and incomplete.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions