{"action":"closed","issue":{"url":"https://api.github.com/repos/golang/go/issues/26532","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/26532/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/26532/comments","events_url":"https://api.github.com/repos/golang/go/issues/26532/events","html_url":"https://github.com/golang/go/issues/26532","id":343394994,"node_id":"MDU6SXNzdWUzNDMzOTQ5OTQ=","number":26532,"title":"mime/multipart: FormDataContentType doesn't properly use quoted-string","user":{"login":"FMNSSun","id":96724,"node_id":"MDQ6VXNlcjk2NzI0","avatar_url":"https://avatars3.githubusercontent.com/u/96724?v=4","gravatar_id":"","url":"https://api.github.com/users/FMNSSun","html_url":"https://github.com/FMNSSun","followers_url":"https://api.github.com/users/FMNSSun/followers","following_url":"https://api.github.com/users/FMNSSun/following{/other_user}","gists_url":"https://api.github.com/users/FMNSSun/gists{/gist_id}","starred_url":"https://api.github.com/users/FMNSSun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FMNSSun/subscriptions","organizations_url":"https://api.github.com/users/FMNSSun/orgs","repos_url":"https://api.github.com/users/FMNSSun/repos","events_url":"https://api.github.com/users/FMNSSun/events{/privacy}","received_events_url":"https://api.github.com/users/FMNSSun/received_events","type":"User","site_admin":false},"labels":[{"id":373402289,"node_id":"MDU6TGFiZWwzNzM0MDIyODk=","url":"https://api.github.com/repos/golang/go/labels/NeedsInvestigation","name":"NeedsInvestigation","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/65","html_url":"https://github.com/golang/go/milestone/65","labels_url":"https://api.github.com/repos/golang/go/milestones/65/labels","id":3072996,"node_id":"MDk6TWlsZXN0b25lMzA3Mjk5Ng==","number":65,"title":"Go1.12","description":"","creator":{"login":"rsc","id":104030,"node_id":"MDQ6VXNlcjEwNDAzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/104030?v=4","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":378,"closed_issues":567,"state":"open","created_at":"2018-01-29T21:17:52Z","updated_at":"2018-12-13T23:59:02Z","due_on":"2019-01-31T08:00:00Z","closed_at":null},"comments":4,"created_at":"2018-07-22T10:30:23Z","updated_at":"2018-12-13T23:59:02Z","closed_at":"2018-12-13T23:59:02Z","author_association":"NONE","body":"I've noticed this while digging into #26521 but afaict ParseMediaType behaves correctly according to RFC 2045 but the FormDataContentType doesn't return quoted-string. The function mentions that it formats according to `Content-Type` header but RFC 2616 Sect. 2.2 also excludes special characters\r\nfor use in `token` and must be part of a `quoted-string` as well.\r\n\r\n\r\n### What version of Go are you using (`go version`)?\r\n\r\ngo 1.10.3\r\n\r\n### Does this issue reproduce with the latest release?\r\n \r\nYes.\r\n\r\n### What did you do?\r\n\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"mime/multipart\"\r\n\t\"mime\"\r\n\t\"os\"\r\n\t\"fmt\"\r\n)\r\n\r\nfunc main() {\r\n\tw := multipart.NewWriter(os.Stdout)\r\n\terr := w.SetBoundary(\"(boundary)\")\r\n\tfmt.Println(err)\r\n\tct := w.FormDataContentType()\r\n\t_, _, err = mime.ParseMediaType(ct)\r\n\tfmt.Println(ct, err)\r\n}\r\n\r\n```\r\n(https://play.golang.org/p/5ZPC_EGHODn)\r\n\r\n### What did you expect to see?\r\n\r\n```\r\nmultipart/form-data; boundary=\"(boundary)\"\r\n```\r\n\r\n### What did you see instead?\r\n\r\n```\r\nmultipart/form-data; boundary=(boundary)\r\n```\r\n\r\nWhich according to RFC 2045 and RFC 2616 is illegal as `(` belongs to special characters that are only allowed in quoted-strings. "}}
{"actor":{"display_login":"gopherbot"}}