From dc8c230ad45a10be93fc2cd79c38ebb39fd0a148 Mon Sep 17 00:00:00 2001 From: erkin Date: Thu, 16 Dec 2021 17:31:48 +0300 Subject: remote: T4037: Report the final URL when following redirects --- python/vyos/remote.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python/vyos/remote.py b/python/vyos/remote.py index 732ef76b7..694ea62ab 100644 --- a/python/vyos/remote.py +++ b/python/vyos/remote.py @@ -241,11 +241,9 @@ class HttpC: # Abort early if the destination is inaccessible. r.raise_for_status() # If the request got redirected, keep the last URL we ended up with. + final_urlstring = r.url if r.history: - final_urlstring = r.history[-1].url print_error('Redirecting to ' + final_urlstring) - else: - final_urlstring = self.urlstring # Check for the prospective file size. try: size = int(r.headers['Content-Length']) -- cgit v1.2.3