diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc index d051225a7..b5d503940 100644 --- a/src/libutil/hash.cc +++ b/src/libutil/hash.cc @@ -164,7 +164,7 @@ static Hash parseLowLevel( return res; } -Hash Hash::parseSRI(std::string_view original) +Hash Hash::parseSRI(std::string_view original, const ExperimentalFeatureSettings & xpSettings) { auto rest = original; @@ -172,9 +172,9 @@ Hash Hash::parseSRI(std::string_view original) auto hashRaw = splitPrefixTo(rest, '-'); if (!hashRaw) throw BadHash("hash '%s' is not SRI", original); - HashAlgorithm parsedType = parseHashAlgo(*hashRaw); + HashAlgorithm parsedType = parseHashAlgo(*hashRaw, xpSettings); - return parseLowLevel(rest, parsedType, {base64::decode, "SRI"}); + return parseLowLevel(rest, parsedType, {base64::decode, "SRI"}, xpSettings); } /** diff --git a/src/libutil/include/nix/util/hash.hh b/src/libutil/include/nix/util/hash.hh index 199a9dd49..54b705105 100644 --- a/src/libutil/include/nix/util/hash.hh +++ b/src/libutil/include/nix/util/hash.hh @@ -110,7 +110,8 @@ struct Hash HashFormat explicitFormat, const ExperimentalFeatureSettings & xpSettings = experimentalFeatureSettings); - static Hash parseSRI(std::string_view original); + static Hash + parseSRI(std::string_view original, const ExperimentalFeatureSettings & xpSettings = experimentalFeatureSettings); public: /**