Canonicalize binary caches with ‘/’ when one is missing

This checks if there is a trusted substituter with a slash, so
trusting https://cache.nixos.org also implies https://cache.nixos.org/
is trusted.
This commit is contained in:
Matthew Bauer 2020-12-04 22:17:19 -06:00
parent 6ed09cb8c2
commit b9a00fd15b

View file

@ -215,6 +215,8 @@ struct ClientSettings
for (auto & s : ss)
if (trusted.count(s))
subs.push_back(s);
else if (!hasSuffix(s, "/") && trusted.count(s + "/"))
subs.push_back(s + "/");
else
warn("ignoring untrusted substituter '%s'", s);
res = subs;