{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/27197","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/27197/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/27197/comments","events_url":"https://api.github.com/repos/golang/go/issues/27197/events","html_url":"https://github.com/golang/go/issues/27197","id":353747225,"node_id":"MDU6SXNzdWUzNTM3NDcyMjU=","number":27197,"title":"net/http: option to allow Trailer header without chunked transfer encoding in HTTP response","user":{"login":"VictoriaRaymond","id":26386597,"node_id":"MDQ6VXNlcjI2Mzg2NTk3","avatar_url":"https://avatars3.githubusercontent.com/u/26386597?v=4","gravatar_id":"","url":"https://api.github.com/users/VictoriaRaymond","html_url":"https://github.com/VictoriaRaymond","followers_url":"https://api.github.com/users/VictoriaRaymond/followers","following_url":"https://api.github.com/users/VictoriaRaymond/following{/other_user}","gists_url":"https://api.github.com/users/VictoriaRaymond/gists{/gist_id}","starred_url":"https://api.github.com/users/VictoriaRaymond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VictoriaRaymond/subscriptions","organizations_url":"https://api.github.com/users/VictoriaRaymond/orgs","repos_url":"https://api.github.com/users/VictoriaRaymond/repos","events_url":"https://api.github.com/users/VictoriaRaymond/events{/privacy}","received_events_url":"https://api.github.com/users/VictoriaRaymond/received_events","type":"User","site_admin":false},"labels":[{"id":373399998,"node_id":"MDU6TGFiZWwzNzMzOTk5OTg=","url":"https://api.github.com/repos/golang/go/labels/NeedsFix","name":"NeedsFix","color":"ededed","default":false}],"state":"open","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":707,"closed_issues":349,"state":"open","created_at":"2018-01-29T21:17:52Z","updated_at":"2018-10-28T20:21:02Z","due_on":"2019-01-31T08:00:00Z","closed_at":null},"comments":7,"created_at":"2018-08-24T11:31:04Z","updated_at":"2018-10-28T22:17:16Z","closed_at":null,"author_association":"NONE","body":"Please answer these questions before submitting your issue. Thanks!\r\n\r\n### What version of Go are you using (`go version`)?\r\n1.10\r\n\r\n### Does this issue reproduce with the latest release?\r\nYes, as the code is not changed.\r\n\r\n### What operating system and processor architecture are you using (`go env`)?\r\nMac OS 10.13 (don't matter actually)\r\n\r\n### What did you do?\r\nRead HTTP response via http.ReadResponse(). The HTTP response contains a \"Trailer\" header but no \"Transfer-Encoding\" head. This leads to an error during header parsing.\r\n\r\nIt is not possible to reproduce using the original URL for http request/response, as the URL requires authentication in advance. Here is a simplified code using static real response.\r\n\r\nhttps://play.golang.org/p/nuL0CnYF1tu\r\n\r\n### What did you expect to see?\r\nSince response body is not chunked in such case, the \"Trailer\" header can be considered (as least optionally) as a \"no-op\". It would be nice that net/http can ignore such error (by default, or with an option), and let caller to decide whether the response is valid or not.\r\n\r\nRFC 7230 doesn't say anything regarding such case. It only mentions positive case when Transfer-Encoding is used.\r\n\r\nReference:\r\nhttps://tools.ietf.org/html/rfc7230#section-4.4\r\nhttps://tools.ietf.org/html/rfc7230#section-4.1.2\r\n\r\n### What did you see instead?\r\nReadResponse() returns ErrUnexpectedTrailer, which is originated from here: https://github.com/golang/go/blob/master/src/net/http/transfer.go#L761\r\n\r\nFor the moment, the caller has no choice but to discard the HTTP response.\r\n"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/433746691","html_url":"https://github.com/golang/go/issues/27197#issuecomment-433746691","issue_url":"https://api.github.com/repos/golang/go/issues/27197","id":433746691,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzc0NjY5MQ==","user":{"login":"bradfitz","id":2621,"node_id":"MDQ6VXNlcjI2MjE=","avatar_url":"https://avatars1.githubusercontent.com/u/2621?v=4","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},"created_at":"2018-10-28T22:17:16Z","updated_at":"2018-10-28T22:17:16Z","author_association":"MEMBER","body":"Sure"}}
{"actor":{"display_login":"bradfitz"}}