{"action":"created","issue":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/3366","repository_url":"https://api.github.com/repos/kennethreitz/requests","labels_url":"https://api.github.com/repos/kennethreitz/requests/issues/3366/labels{/name}","comments_url":"https://api.github.com/repos/kennethreitz/requests/issues/3366/comments","events_url":"https://api.github.com/repos/kennethreitz/requests/issues/3366/events","html_url":"https://github.com/kennethreitz/requests/pull/3366","id":162988175,"number":3366,"title":"check for headers containing return characters","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":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":25,"created_at":"2016-06-29T17:57:41Z","updated_at":"2016-08-11T20:20:37Z","closed_at":"2016-07-02T19:32:17Z","pull_request":{"url":"https://api.github.com/repos/kennethreitz/requests/pulls/3366","html_url":"https://github.com/kennethreitz/requests/pull/3366","diff_url":"https://github.com/kennethreitz/requests/pull/3366.diff","patch_url":"https://github.com/kennethreitz/requests/pull/3366.patch"},"body":"Addresses issue raised in #2947.\r\n\r\nThis likely needs some tweaking. I added the check in `adapters.py` because it was the lowest level I could find header modification being done before sending. I'm not sure it actually needs to be this low though since it doesn't seem easily reachable with a non-`PreparedRequest` object.\r\n\r\nAlternatively, we could move the check to the [`prepare_headers`](https://github.com/kennethreitz/requests/blob/master/requests/models.py#L406) method in `PreparedRequest`.\r\n\r\nI also ignored `Accept` headers in the check because I the requirements in [RFC7230](https://tools.ietf.org/html/rfc7230#page-24) seems a bit vague.\r\n\r\n  >This specification deprecates such line folding except within the message/http media type\r\n   (Section 8.3.1).  A sender MUST NOT generate a message that includes line folding (i.e., that has any    field-value that contains a match to the obs-fold rule) unless the message is intended for packaging\r\n   within the message/http media type.\r\n\r\nThis may be a poor interpretation on my part though.\r\n"},"comment":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/comments/239279748","html_url":"https://github.com/kennethreitz/requests/pull/3366#issuecomment-239279748","issue_url":"https://api.github.com/repos/kennethreitz/requests/issues/3366","id":239279748,"user":{"login":"saper","id":248374,"avatar_url":"https://avatars.githubusercontent.com/u/248374?v=3","gravatar_id":"","url":"https://api.github.com/users/saper","html_url":"https://github.com/saper","followers_url":"https://api.github.com/users/saper/followers","following_url":"https://api.github.com/users/saper/following{/other_user}","gists_url":"https://api.github.com/users/saper/gists{/gist_id}","starred_url":"https://api.github.com/users/saper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saper/subscriptions","organizations_url":"https://api.github.com/users/saper/orgs","repos_url":"https://api.github.com/users/saper/repos","events_url":"https://api.github.com/users/saper/events{/privacy}","received_events_url":"https://api.github.com/users/saper/received_events","type":"User","site_admin":false},"created_at":"2016-08-11T20:20:37Z","updated_at":"2016-08-11T20:20:37Z","body":"Question: Did implicit stringification work correctly in both Python releases? (Before we needed an explicit one to cut away newlines)?\r\n\r\nI've seen [{k: str(v) for k, v in headers.items()})](https://github.com/jjjake/internetarchive/pull/150/files#diff-562526d0e51ec94fea4ddda8c54853e5R155).proposed as a fix and I understand from what you are saying that explicit stringification is no good."}}
{"actor":{"display_login":"saper"}}