From 1c7a91385de3443c7fc3da148b54bb8b9b60bed3 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Thu, 24 Mar 2016 14:56:16 -0400 Subject: [PATCH] urlfetcher: Fix distro detection with http->https redirects Need to tell requests.head request to follow the redirect automatically, otherwise the 301 response throws us off. Saw this with http://d-i.debian.org/ --- virtinst/urlfetcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py index 79f66e5e1..f45cb1f39 100644 --- a/virtinst/urlfetcher.py +++ b/virtinst/urlfetcher.py @@ -178,7 +178,7 @@ class _HTTPURLFetcher(_URLFetcher): We just do a HEAD request to see if the file exists """ try: - response = requests.head(url) + response = requests.head(url, allow_redirects=True) response.raise_for_status() except Exception, e: logging.debug("HTTP hasFile request failed: %s", str(e))