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

Add response.future_requests_uri, deprecate response.is_permanent_redirect #5436

Open
SoniEx2 opened this issue Apr 24, 2020 · 6 comments
Open

Comments

@SoniEx2
Copy link

SoniEx2 commented Apr 24, 2020

response.is_permanent_redirect is unreliable/useless/dangerous for chains of redirects, just give the user the correct URI instead.

example use-case: foo redirects temporarily to bar, which in turn redirects permanently to baz. future requests should still be made to foo, but using is_permanent_redirect would lead to them being made to baz instead.

@sigmavirus24
Copy link
Contributor

That method was not introduced for users to use and was part of internal machinery that was ripped out

@SoniEx2
Copy link
Author

SoniEx2 commented Apr 24, 2020

@altendky
Copy link
Contributor

I think an alternative check for the first history item being a permanent redirect would be a more accurate way to calculate this? The actual permanent redirect url would be gotten from the last permanent redirect among the contiguous group of initial permanent redirects. Maybe?

@sigmavirus24
Copy link
Contributor

@SoniEx2 I believe autoclass will auto-document a public method. That doesn't mean it's encouraged for you to use

@altendky
Copy link
Contributor

Could we get it removed from the docs? It's hard to expect developers to consider a documented non-leading-_ attribute private... Or implement it more sensibly (based on my minute or two of thought, maybe I'm missing something).

@SoniEx2
Copy link
Author

SoniEx2 commented Apr 25, 2020

it does add value fwiw - if you're doing things yourself.

but don't rely on it as representative of the whole response chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants