{"action":"created","issue":{"url":"https://api.github.com/repos/python-hyper/hyper-h2/issues/382","repository_url":"https://api.github.com/repos/python-hyper/hyper-h2","labels_url":"https://api.github.com/repos/python-hyper/hyper-h2/issues/382/labels{/name}","comments_url":"https://api.github.com/repos/python-hyper/hyper-h2/issues/382/comments","events_url":"https://api.github.com/repos/python-hyper/hyper-h2/issues/382/events","html_url":"https://github.com/python-hyper/hyper-h2/pull/382","id":187540313,"number":382,"title":"Remove connection specific headers","user":{"login":"nateprewitt","id":5271761,"avatar_url":"https://avatars.githubusercontent.com/u/5271761?v=3","gravatar_id":"","url":"https://api.github.com/users/nateprewitt","html_url":"https://github.com/nateprewitt","followers_url":"https://api.github.com/users/nateprewitt/followers","following_url":"https://api.github.com/users/nateprewitt/following{/other_user}","gists_url":"https://api.github.com/users/nateprewitt/gists{/gist_id}","starred_url":"https://api.github.com/users/nateprewitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nateprewitt/subscriptions","organizations_url":"https://api.github.com/users/nateprewitt/orgs","repos_url":"https://api.github.com/users/nateprewitt/repos","events_url":"https://api.github.com/users/nateprewitt/events{/privacy}","received_events_url":"https://api.github.com/users/nateprewitt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-06T03:56:48Z","updated_at":"2016-11-06T20:00:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/python-hyper/hyper-h2/pulls/382","html_url":"https://github.com/python-hyper/hyper-h2/pull/382","diff_url":"https://github.com/python-hyper/hyper-h2/pull/382.diff","patch_url":"https://github.com/python-hyper/hyper-h2/pull/382.patch"},"body":"This should address the issue discussed in lukasa/hyper#291. I expanded the scope of this PR a bit after reading RFC7540 because it has pretty clear wording on what to do in this situation.\r\n\r\n###### RFC7540 §  8.1.2.2\r\n> This means that an intermediary transforming an HTTP/1.x message to\r\n   HTTP/2 will need to remove any header fields nominated by the\r\n   Connection header field, along with the Connection header field\r\n   itself.  Such intermediaries SHOULD also remove other connection-\r\n   specific header fields, such as Keep-Alive, Proxy-Connection,\r\n   Transfer-Encoding, and Upgrade, even if they are not nominated by the\r\n   Connection header field.\r\n\r\nThere may have been another discussion on why this portion wasn't previously implemented but I couldn't find it from a cursory search.\r\n\r\nWith this patch, `h2` will now strip all connection related fields from headers. While the RFC specifies this specifically for messages transformed from HTTP/1.x to HTTP/2, I didn't initially implement a check because I wanted to check first. Does this distinction matter in practice, or will a universal strip work?"},"comment":{"url":"https://api.github.com/repos/python-hyper/hyper-h2/issues/comments/258706254","html_url":"https://github.com/python-hyper/hyper-h2/pull/382#issuecomment-258706254","issue_url":"https://api.github.com/repos/python-hyper/hyper-h2/issues/382","id":258706254,"user":{"login":"nateprewitt","id":5271761,"avatar_url":"https://avatars.githubusercontent.com/u/5271761?v=3","gravatar_id":"","url":"https://api.github.com/users/nateprewitt","html_url":"https://github.com/nateprewitt","followers_url":"https://api.github.com/users/nateprewitt/followers","following_url":"https://api.github.com/users/nateprewitt/following{/other_user}","gists_url":"https://api.github.com/users/nateprewitt/gists{/gist_id}","starred_url":"https://api.github.com/users/nateprewitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nateprewitt/subscriptions","organizations_url":"https://api.github.com/users/nateprewitt/orgs","repos_url":"https://api.github.com/users/nateprewitt/repos","events_url":"https://api.github.com/users/nateprewitt/events{/privacy}","received_events_url":"https://api.github.com/users/nateprewitt/received_events","type":"User","site_admin":false},"created_at":"2016-11-06T20:00:04Z","updated_at":"2016-11-06T20:00:04Z","body":"@alexwlchan @Lukasa, it looks like force pushing removed my last response and I can no longer respond to your comment in h2/utilities.py.\r\n\r\nIn short, I've moved everything over to `normalize_outbound_headers` which now allows h2 to raise a ProtocolError when bad headers are received. Both scenarios you've listed involve receiving rather than sending, so I believe this covers those cases.\r\n\r\n> An endpoint MUST NOT generate an HTTP/2 message containing connection-specific header fields;\r\n\r\nIn regards to a flag, I think stripping the headers satisfies the above requirement, but I can see a scenario where the user would rather catch the exception and modify the request flow. If this feature is needed, how does something like a `normalize_transformed_connection` flag with an additional function run prior to `normalize_outbound_headers` sound?"}}
{"actor":{"display_login":"nateprewitt"}}