Skip to content

Commit

Permalink
downloadLocation URIs not case sensitive
Browse files Browse the repository at this point in the history
Signed-off-by: Claes Nordmark <[email protected]>
  • Loading branch information
konsulten committed Sep 30, 2024
1 parent a25937f commit b8088ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/spdx_tools/spdx/validation/uri_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand All @@ -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 []
Expand Down

0 comments on commit b8088ef

Please sign in to comment.