summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--python/vyos/remote.py4
1 files changed, 1 insertions, 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'])