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

View File

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