Issue 12275: urllib.request.HTTPRedirectHandler won't redirect to a URL with only path but not domain (original) (raw)

Issue12275

Created on 2011-06-07 07:10 by lilydjwg, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg137791 - (view) Author: lilydjwg (lilydjwg) * Date: 2011-06-07 07:10
On redirecting to a url like '/login', at around line 556 of request.py it will raise an HTTPError. The sys.verrsion is Python 3.2 (r32:88445, Apr 15 2011, 11:20:08) [GCC 4.5.2 20110127 (prerelease)] on linux2
msg137802 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-06-07 11:04
Well, the HTTP RFC does indicate that the redirection URI (in the Location header: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30) must be an absolute URI, but I also agree that using a relative URI in that context is a common use-case supported by browsers, and it would be good to support it in the stdlib too.
msg240464 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-04-11 06:35
Already fixed in 3.2 it seems
History
Date User Action Args
2022-04-11 14:57:18 admin set github: 56484
2015-04-11 06:35:18 martin.panter set status: open -> closedsuperseder: [urllib.request.HTTPRedirectHandler.http_error_302] Relative Redirect issueversions: - Python 3.3nosy: + martin.pantermessages: + resolution: duplicatestage: needs patch -> resolved
2011-06-07 11:04:54 pitrou set versions: + Python 3.3nosy: + orsenthil, pitroumessages: + type: behaviorstage: needs patch
2011-06-07 07:10:17 lilydjwg create