Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop RedirectLoop exception #819

Merged
merged 3 commits into from
Feb 24, 2020
Merged

Conversation

oczkers
Copy link
Contributor

@oczkers oczkers commented Feb 20, 2020

Simply drop RedirectLoop exception and instead rely on max number of redirects (and retries on future) like requests, urllib3 and many others do.
More info in previous closed pr #801

async def test_redirect_loop():
client = AsyncClient(dispatch=MockDispatch())
with pytest.raises(RedirectLoop):
await client.get("https://example.org/redirect_loop")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could keep this test in, and just ensure that TooManyRedirects is raised?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already test for TooManyRedirects with 21 redirects so i thought it's gonna be enough but sure more is better.

Copy link
Member

@tomchristie tomchristie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me yup!

There's one test case here that we could potentially change to a TooManyRedirects test case. Although I'd probably be happy to accept the PR either way.

Anyone else got feedback on this?

@tomchristie tomchristie merged commit efe9f61 into encode:master Feb 24, 2020
@tomchristie
Copy link
Member

Fab, thanks!

@tomchristie
Copy link
Member

Minor API change here, which is fine since we're already commited to the next release being 0.12.0

@florimondmanca florimondmanca mentioned this pull request Mar 4, 2020
3 tasks
@tomchristie tomchristie mentioned this pull request Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants