Skip to content

Commit 1ecc6f6

Browse files
bdehamerarmintaenzertng
authored andcommitted
expand url regex to allow for userinfo
Signed-off-by: Brian DeHamer <bdehamer@github.com>
1 parent ee95e60 commit 1ecc6f6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/spdx_tools/spdx/validation/uri_validators.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
url_pattern = (
1111
"(http:\\/\\/www\\.|https:\\/\\/www\\.|http:\\/\\/|https:\\/\\/|ssh:\\/\\/|git:\\/\\/|svn:\\/\\/|sftp:"
12-
"\\/\\/|ftp:\\/\\/)?[a-z0-9]+([\\-\\.]{1}[a-z0-9]+){0,100}\\.[a-z]{2,5}(:[0-9]{1,5})?(\\/.*)?"
12+
"\\/\\/|ftp:\\/\\/)?([\\w\\-.!~*'()%;:&=+$,]+@)?[a-z0-9]+([\\-\\.]{1}[a-z0-9]+){0,100}\\.[a-z]{2,5}"
13+
"(:[0-9]{1,5})?(\\/.*)?"
1314
)
1415
supported_download_repos: str = "(git|hg|svn|bzr)"
1516
git_pattern = "(git\\+git@[a-zA-Z0-9\\.\\-]+:[a-zA-Z0-9/\\\\.@\\-]+)"

tests/spdx/validation/test_uri_validators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def test_invalid_url(input_value):
3434
"git+https://git.myproject.org/MyProject.git",
3535
"git+http://git.myproject.org/MyProject",
3636
"git+ssh://git.myproject.org/MyProject.git",
37+
"git+ssh://git@git.myproject.org/MyProject.git",
3738
"git+git://git.myproject.org/MyProject",
3839
"git+git@git.myproject.org:MyProject",
3940
"git://git.myproject.org/MyProject#src/somefile.c",

0 commit comments

Comments
 (0)