Skip to content

Commit 0b5210a

Browse files
[issue-825] Allow capital letters in validate_url()
Signed-off-by: Armin Tänzer <[email protected]>
1 parent 47751b6 commit 0b5210a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/spdx_tools/spdx/validation/uri_validators.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"\\/\\/|ftp:\\/\\/)?([\\w\\-.!~*'()%;:&=+$,]+@)?[a-z0-9]+([\\-\\.]{1}[a-z0-9]+){0,100}\\.[a-z]{2,5}"
1313
"(:[0-9]{1,5})?(\\/.*)?"
1414
)
15+
url_pattern_ignore_case = re.compile(url_pattern, re.IGNORECASE)
16+
1517
supported_download_repos: str = "(git|hg|svn|bzr)"
1618
git_pattern = "(git\\+git@[a-zA-Z0-9\\.\\-]+:[a-zA-Z0-9/\\\\.@\\-]+)"
1719
bazaar_pattern = "(bzr\\+lp:[a-zA-Z0-9\\.\\-]+)"
@@ -22,7 +24,7 @@
2224

2325

2426
def validate_url(url: str) -> List[str]:
25-
if not re.match(url_pattern, url):
27+
if not url_pattern_ignore_case.match(url):
2628
return [f"must be a valid URL, but is: {url}"]
2729

2830
return []

0 commit comments

Comments
 (0)