{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/11289","labels_url":"https://api.github.com/repos/golang/go/issues/11289/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/11289/comments","events_url":"https://api.github.com/repos/golang/go/issues/11289/events","html_url":"https://github.com/golang/go/issues/11289","id":89550156,"number":11289,"title":"mime: ParseMediaType parses invalid media types","user":{"login":"dvyukov","id":1095328,"avatar_url":"https://avatars.githubusercontent.com/u/1095328?v=3","gravatar_id":"","url":"https://api.github.com/users/dvyukov","html_url":"https://github.com/dvyukov","followers_url":"https://api.github.com/users/dvyukov/followers","following_url":"https://api.github.com/users/dvyukov/following{/other_user}","gists_url":"https://api.github.com/users/dvyukov/gists{/gist_id}","starred_url":"https://api.github.com/users/dvyukov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvyukov/subscriptions","organizations_url":"https://api.github.com/users/dvyukov/orgs","repos_url":"https://api.github.com/users/dvyukov/repos","events_url":"https://api.github.com/users/dvyukov/events{/privacy}","received_events_url":"https://api.github.com/users/dvyukov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"bradfitz","id":2621,"avatar_url":"https://avatars.githubusercontent.com/u/2621?v=3","gravatar_id":"","url":"https://api.github.com/users/bradfitz","html_url":"https://github.com/bradfitz","followers_url":"https://api.github.com/users/bradfitz/followers","following_url":"https://api.github.com/users/bradfitz/following{/other_user}","gists_url":"https://api.github.com/users/bradfitz/gists{/gist_id}","starred_url":"https://api.github.com/users/bradfitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradfitz/subscriptions","organizations_url":"https://api.github.com/users/bradfitz/orgs","repos_url":"https://api.github.com/users/bradfitz/repos","events_url":"https://api.github.com/users/bradfitz/events{/privacy}","received_events_url":"https://api.github.com/users/bradfitz/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/24","html_url":"https://github.com/golang/go/milestones/Go1.6","labels_url":"https://api.github.com/repos/golang/go/milestones/24/labels","id":1096159,"number":24,"title":"Go1.6","description":"","creator":{"login":"josharian","id":67496,"avatar_url":"https://avatars.githubusercontent.com/u/67496?v=3","gravatar_id":"","url":"https://api.github.com/users/josharian","html_url":"https://github.com/josharian","followers_url":"https://api.github.com/users/josharian/followers","following_url":"https://api.github.com/users/josharian/following{/other_user}","gists_url":"https://api.github.com/users/josharian/gists{/gist_id}","starred_url":"https://api.github.com/users/josharian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josharian/subscriptions","organizations_url":"https://api.github.com/users/josharian/orgs","repos_url":"https://api.github.com/users/josharian/repos","events_url":"https://api.github.com/users/josharian/events{/privacy}","received_events_url":"https://api.github.com/users/josharian/received_events","type":"User","site_admin":false},"open_issues":217,"closed_issues":365,"state":"open","created_at":"2015-05-05T02:39:06Z","updated_at":"2015-11-30T20:06:38Z","due_on":"2016-01-31T08:00:00Z","closed_at":null},"comments":3,"created_at":"2015-06-19T12:14:35Z","updated_at":"2015-11-30T22:01:39Z","closed_at":null,"body":"The following program fails with the panic:\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"mime\"\r\n\t\"fmt\"\r\n)\r\n\r\nfunc main() {\r\n\tsdata := \"0\"\r\n\tmt, params, err := mime.ParseMediaType(sdata)\r\n\tif err != nil {\r\n\t\treturn\r\n\t}\r\n\tsdata1 := mime.FormatMediaType(mt, params)\r\n\t_, _, err = mime.ParseMediaType(sdata1)\r\n\tif err != nil {\r\n\t\tfmt.Printf(\"%q(%q, %+v) -> %q\\n\", sdata, mt, params, sdata1)\r\n\t\tpanic(err)\r\n\t}\r\n}\r\n```\r\n```\r\n\"0\"(\"0\", map[]) -> \"\"\r\npanic: mime: no media type\r\n```\r\n\r\nIf \"0\" is not a valid mediatype, then the first ParseMediaType should produce an error.\r\n\r\ngo version devel +514014c Thu Jun 18 15:54:35 2015 +0200 linux/amd64"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/160775348","html_url":"https://github.com/golang/go/issues/11289#issuecomment-160775348","issue_url":"https://api.github.com/repos/golang/go/issues/11289","id":160775348,"user":{"login":"gopherbot","id":8566911,"avatar_url":"https://avatars.githubusercontent.com/u/8566911?v=3","gravatar_id":"","url":"https://api.github.com/users/gopherbot","html_url":"https://github.com/gopherbot","followers_url":"https://api.github.com/users/gopherbot/followers","following_url":"https://api.github.com/users/gopherbot/following{/other_user}","gists_url":"https://api.github.com/users/gopherbot/gists{/gist_id}","starred_url":"https://api.github.com/users/gopherbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gopherbot/subscriptions","organizations_url":"https://api.github.com/users/gopherbot/orgs","repos_url":"https://api.github.com/users/gopherbot/repos","events_url":"https://api.github.com/users/gopherbot/events{/privacy}","received_events_url":"https://api.github.com/users/gopherbot/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T22:01:39Z","updated_at":"2015-11-30T22:01:39Z","body":"CL https://golang.org/cl/17135 mentions this issue."}}