{"action":"opened","issue":{"url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2022","repository_url":"https://api.github.com/repos/aio-libs/aiohttp","labels_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2022/labels{/name}","comments_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2022/comments","events_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2022/events","html_url":"https://github.com/aio-libs/aiohttp/issues/2022","id":238715091,"number":2022,"title":"[enhancement] ability to return redirect responses which don't have 'location' header","user":{"login":"thehesiod","id":4001789,"avatar_url":"https://avatars2.githubusercontent.com/u/4001789?v=3","gravatar_id":"","url":"https://api.github.com/users/thehesiod","html_url":"https://github.com/thehesiod","followers_url":"https://api.github.com/users/thehesiod/followers","following_url":"https://api.github.com/users/thehesiod/following{/other_user}","gists_url":"https://api.github.com/users/thehesiod/gists{/gist_id}","starred_url":"https://api.github.com/users/thehesiod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thehesiod/subscriptions","organizations_url":"https://api.github.com/users/thehesiod/orgs","repos_url":"https://api.github.com/users/thehesiod/repos","events_url":"https://api.github.com/users/thehesiod/events{/privacy}","received_events_url":"https://api.github.com/users/thehesiod/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-27T01:43:46Z","updated_at":"2017-06-27T01:43:46Z","closed_at":null,"body":"based on a recent aiobotocore investigation: https://github.com/aio-libs/aiobotocore/issues/267  it seems that the requests module treats responses which don't have the 'location' header as a regular response and not an exception...however aiohttp ends up throwing a RuntimeError/ClientRedirectError: https://github.com/aio-libs/aiohttp/blob/master/aiohttp/client.py#L278\r\n\r\nAWS occasionally stores the location in the body.  Since aiohttp raises an exception we no longer have access to the response to generate the redirect.\r\n\r\nWe are then left with having to disable redirects and handle redirects on our own.  This would mean re-implementing max_redirects and redirect resolution on our own...so instead I propose adding a flag which allows aiohttp to behave like requests.  If this is approved I can work on a PR.  Thanks!"}}
{"actor":{"display_login":"thehesiod"}}