Skip to content

Commit

Permalink
expand url regex to allow for userinfo
Browse files Browse the repository at this point in the history
Signed-off-by: Brian DeHamer <bdehamer@github.com>
  • Loading branch information
bdehamer authored and armintaenzertng committed Aug 17, 2023
1 parent ee95e60 commit b4c23a1
Show file tree
Hide file tree
Showing 2 changed files with 3 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 @@ -9,7 +9,8 @@

url_pattern = (
"(http:\\/\\/www\\.|https:\\/\\/www\\.|http:\\/\\/|https:\\/\\/|ssh:\\/\\/|git:\\/\\/|svn:\\/\\/|sftp:"
"\\/\\/|ftp:\\/\\/)?[a-z0-9]+([\\-\\.]{1}[a-z0-9]+){0,100}\\.[a-z]{2,5}(:[0-9]{1,5})?(\\/.*)?"
"\\/\\/|ftp:\\/\\/)?([\\w\\-.!~*'()%;:&=+$,]+@)?[a-z0-9]+([\\-\\.]{1}[a-z0-9]+){0,100}\\.[a-z]{2,5}"
"(:[0-9]{1,5})?(\\/.*)?"
)
supported_download_repos: str = "(git|hg|svn|bzr)"
git_pattern = "(git\\+git@[a-zA-Z0-9\\.\\-]+:[a-zA-Z0-9/\\\\.@\\-]+)"
Expand Down
1 change: 1 addition & 0 deletions tests/spdx/validation/test_uri_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def test_invalid_url(input_value):
"git+https://git.myproject.org/MyProject.git",
"git+http://git.myproject.org/MyProject",
"git+ssh://git.myproject.org/MyProject.git",
"git+ssh://git@git.myproject.org/MyProject.git",
"git+git://git.myproject.org/MyProject",
"git+git@git.myproject.org:MyProject",
"git://git.myproject.org/MyProject#src/somefile.c",
Expand Down

0 comments on commit b4c23a1

Please sign in to comment.