Skip to content

mime: be stricter parsing media types #3562

@bradfitz

Description

@bradfitz
This shouldn't be valid:

http://play.golang.org/p/IQ8GeEmP1_

    t, params, err := mime.ParseMediaType(`image/'><style type="text/css">td{background-color:red}</style>`)   
    fmt.Printf("t=%q, p=%v, err=%v", t, params, err)

        t="image/'><style type=\"text/css\">td{background-color:red}</style>", p=map[], err=mime: unexpected content after media subtype


according to: http://www.ietf.org/rfc/rfc1521.txt

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions