-
Notifications
You must be signed in to change notification settings - Fork 42
Closed
spdx/Spdx-Java-Library
#67Description
Describe the bug
If the download location is http://www.google.com, error when converting SPDX.
Caused by: org.spdx.library.InvalidSPDXAnalysisException: Invalid download location pattern http://www.google.com. Must match the pattern ^(NONE|NOASSERTION|(((git|hg|svn|bzr)\+)?(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})?(\/.*))|(git\+git@[a-zA-Z0-9\.]+:[a-zA-Z0-9/\\.@]+)|(bzr\+lp:[a-zA-Z0-9\.]+))$
web_1 | at org.spdx.library.model.SpdxPackage.setDownloadLocation(SpdxPackage.java:239)
web_1 | at org.spdx.library.model.SpdxPackage.<init>(SpdxPackage.java:111)
web_1 | at org.spdx.library.model.SpdxPackage$SpdxPackageBuilder.build(SpdxPackage.java:1036)
web_1 | at org.spdx.spreadsheetstore.PackageInfoSheetV2d2.getPackage(PackageInfoSheetV2d2.java:550)
web_1 | ... 81 common frames omitted
SPDX Download location Specification
IMHO, the spec doesn't seem to say that a trailing slash is mandatory.
In VCS location compact notations,
the trailing slashes in <host_name>, <path_to_repository> are not significant.
Leading and trailing slashes in <sub_path> are not significant.
download location regular expression
This is the download location regular expression currently used by spdx-tools-java.
^(NONE|NOASSERTION|(((git|hg|svn|bzr)\+)?(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})?(\/.*))|(git\+git@[a-zA-Z0-9\.]+:[a-zA-Z0-9/\\.@]+)|(bzr\+lp:[a-zA-Z0-9\.]+))$
Metadata
Metadata
Assignees
Labels
No labels