diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index 30e6823207e..f1f787f4c7f 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -276,7 +276,8 @@ def fetch(self): # Check if we somehow got an HTML file rather than the archive we # asked for. We only look at the last content type, to handle # redirects properly. - content_types = re.findall(r'Content-Type:[^\r\n]+', headers) + content_types = re.findall(r'Content-Type:[^\r\n]+', headers, + flags=re.IGNORECASE) if content_types and 'text/html' in content_types[-1]: tty.warn("The contents of ", (self.archive_file if self.archive_file is not None