You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
urllib / urllib2 should cache 301 redirections #38478
urllib / urllib2 should cache the results of 301
(permanent) redirections. This shouldn't break
anything, since it's just an internal optimisation
from one point of view -- but it's also what the
RFC (2616, section 10.3.2, first para) says
SHOULD happen.
Hi gbrandll/jjlee,
I am trying to understand the actual requirements here.
Should the original url be avaiable to the user upon request as urllib
automatically calls the redirect_request and provides the redirected url only?
Please provide some details on this bug. I shall try to write a patch.
In what respect? I just meant that it would be nice (and more compliant
with the RFC) if rather than fetching the original URL each time, a map
of URLs to 301-redirected URLs was kept.
For urllib2, I suppose the map would be a private attribute of
HTTPRedirectHandler.
There's no obvious need to provide any interface to get the intermediate
URLs in the redirection chain.
Activity
jjlee commentedon May 10, 2003
urllib / urllib2 should cache the results of 301
(permanent) redirections. This shouldn't break
anything, since it's just an internal optimisation
from one point of view -- but it's also what the
RFC (2616, section 10.3.2, first para) says
SHOULD happen.
orsenthil commentedon Jul 6, 2007
Hi gbrandll/jjlee,
I am trying to understand the actual requirements here.
Should the original url be avaiable to the user upon request as urllib
automatically calls the redirect_request and provides the redirected url only?
Please provide some details on this bug. I shall try to write a patch.
Thanks,
Senthil
birkenfeld commentedon Jan 20, 2008
John, what did you have in mind?
jjlee commentedon Jan 20, 2008
In what respect? I just meant that it would be nice (and more compliant
with the RFC) if rather than fetching the original URL each time, a map
of URLs to 301-redirected URLs was kept.
For urllib2, I suppose the map would be a private attribute of
HTTPRedirectHandler.
There's no obvious need to provide any interface to get the intermediate
URLs in the redirection chain.
devdanzin commentedon Apr 27, 2009
Patch in bpo-1755841.