Skip to content

Commit

Permalink
chore(pub): Directly specify the hash algorithm as it is known
Browse files Browse the repository at this point in the history
This avoids the guessing logic depending on the value's length to kick
in.

Signed-off-by: Sebastian Schuberth <[email protected]>
sschuberth authored and fviernau committed Feb 2, 2024
1 parent 5213ce3 commit d602075
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/package-managers/pub/src/main/kotlin/Pub.kt
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@ import org.ossreviewtoolkit.downloader.VcsHost
import org.ossreviewtoolkit.downloader.VersionControlSystem
import org.ossreviewtoolkit.model.EMPTY_JSON_NODE
import org.ossreviewtoolkit.model.Hash
import org.ossreviewtoolkit.model.HashAlgorithm
import org.ossreviewtoolkit.model.Identifier
import org.ossreviewtoolkit.model.Issue
import org.ossreviewtoolkit.model.Package
@@ -609,7 +610,7 @@ class Pub(

RemoteArtifact(
url = "$hostUrl/packages/$rawName/versions/$version.tar.gz",
hash = Hash.create(sha256)
hash = Hash.create(sha256, HashAlgorithm.SHA256.name)
)
} else {
RemoteArtifact.EMPTY

0 comments on commit d602075

Please sign in to comment.