1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-11 13:06:01 +01:00

Limit to lenient parsing of non-standard URLs only where needed

This allows us to put `parseURL` in more spots without furthering
technical debt.
This commit is contained in:
John Ericson 2025-08-22 12:26:11 -04:00
parent 4083eff0c0
commit 72a548ed6a
8 changed files with 76 additions and 51 deletions

View file

@ -185,7 +185,7 @@ static void prim_fetchClosure(EvalState & state, const PosIdx pos, Value ** args
{.msg = HintFmt("attribute '%s' is missing in call to 'fetchClosure'", "fromStore"),
.pos = state.positions[pos]});
auto parsedURL = parseURL(*fromStoreUrl);
auto parsedURL = parseURL(*fromStoreUrl, /*lenient=*/true);
if (parsedURL.scheme != "http" && parsedURL.scheme != "https"
&& !(getEnv("_NIX_IN_TEST").has_value() && parsedURL.scheme == "file"))