Skip to content

mime: FormatMediaType and ParseMediaType not compatible across 1.24 to 1.25 #76236

@kyleshattuck-wf

Description

@kyleshattuck-wf

Go version

go.1.25.0

Output of go env in your module/workspace:

not running locally. Reproducible in go playground.

What did you do?

example in go playground

  1. FormatMediaType with go 1.24 will not add double quotes around a filename with curly braces.
  2. ParseMediaType fails with go 1.25 to parse content dispositions with curly braces without the double quotes.

What did you see happen?

Trying to run ParseMediaType on string attachment; filename={file}.png fails in go 1.25, even though it was generated 1.24

What did you expect to see?

I would expect the output of FormatMediaType in go 1.24 to be parsable by ParseMediaType in go 1.25.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixPendingIssues that have a fix which has not yet been reviewed or submitted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions