Add debug support to show if a URL request resulted in a redirect

This commit is contained in:
Matt Martz 2019-01-23 11:34:00 -06:00
parent ca2250f700
commit 9ac1091eae
1 changed files with 2 additions and 0 deletions

View File

@ -666,6 +666,8 @@ def catch_request(request, opener=None):
try: try:
uh = _open(request) uh = _open(request)
if request.get_full_url() != uh.geturl():
printer('Redirected to %s' % uh.geturl(), debug=True)
return uh, False return uh, False
except HTTP_ERRORS: except HTTP_ERRORS:
e = get_exception() e = get_exception()