diff --git a/src/spdx_tools/spdx/validation/uri_validators.py b/src/spdx_tools/spdx/validation/uri_validators.py index c14d196f4..b2bc91692 100644 --- a/src/spdx_tools/spdx/validation/uri_validators.py +++ b/src/spdx_tools/spdx/validation/uri_validators.py @@ -18,6 +18,7 @@ download_location_pattern = ( "^(((" + supported_download_repos + "\\+)?" + url_pattern + ")|" + git_pattern + "|" + bazaar_pattern + ")$" ) +compiled_pattern = re.compile(download_location_pattern, re.IGNORECASE) def validate_url(url: str) -> List[str]: @@ -28,7 +29,7 @@ def validate_url(url: str) -> List[str]: def validate_download_location(location: str) -> List[str]: - if not (validate_url(location) == [] or re.match(download_location_pattern, location)): + if not (validate_url(location) == [] or compiled_pattern.match(location)): return [f"must be a valid URL or download location according to the specification, but is: {location}"] return []