mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
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/
This commit is contained in:
parent
fdfddff6a4
commit
1c7a91385d
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user