Message150105
I created this patch to further the functionality of redirection using the "location" header in the HTTPRedirectHandler class under urllib/request.py
Currently, the method http_error_302, which will handle code 302 redirection will parse the location header and build a Request accordingly. I encountered a website that only returned "index.php" as the Location header. When http_error_302 called on urlparse, it returned the following tuple: ParseResult(scheme='', netloc='', path='index.php', params='', query='', fragment='')
Then, http_error_302 will check if the scheme is equal to either http, https, or ftp. This is the part I changed in the patch. If it does not pass, an exception is thrown.
Afterwards, http_error_302 builds the target url. As long as the url passes the scheme check, the program will succeed. |
|
Date |
User |
Action |
Args |
2011-12-22 18:41:26 | tkel | set | recipients:
+ tkel, brian.curtin |
2011-12-22 18:41:26 | tkel | set | messageid: <1324579286.85.0.696694544221.issue13651@psf.upfronthosting.co.za> |
2011-12-22 18:41:26 | tkel | link | issue13651 messages |
2011-12-22 18:41:26 | tkel | create | |
|