]> Cypherpunks repositories - gostls13.git/commit
mime: let FormatMediaType format slash-less media types, to mirror ParseMediaType.
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 30 Nov 2015 19:33:49 +0000 (19:33 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 1 Dec 2015 16:29:28 +0000 (16:29 +0000)
commit5ff309f48d4a4ae1995cb930413e62d546079e9c
tree16ca9613ecc8fd16d3f10c2a00f2e0dfe422ae74
parenta3f99dc4e9499c88a784e94ada3c2bd419438c51
mime: let FormatMediaType format slash-less media types, to mirror ParseMediaType.

A Content-Type always has a slash (type/subtype)
A Content-Disposition does not (e.g. "attachment" or "line").
A "media type" is either one of those, plus optional parameters afterwards.

Our ParseMediaType and FormatMediaType weren't consistent in whether
they permitted Content-Dispositions. Now they both do.

Fixes #11289

Change-Id: Ia75723c9d7adb7f4de0f65482780f823cdadb5bd
Reviewed-on: https://go-review.googlesource.com/17135
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/mime/mediatype.go
src/mime/mediatype_test.go