mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
Fix url parsing for urls using file+
`file+https://example.org/test.mp4` should not be rejected with `unexpected authority`.
This commit is contained in:
parent
b911307d7a
commit
4d50995eff
2 changed files with 24 additions and 3 deletions
|
@ -30,13 +30,13 @@ ParsedURL parseURL(const std::string & url)
|
|||
auto & query = match[6];
|
||||
auto & fragment = match[7];
|
||||
|
||||
auto isFile = scheme.find("file") != std::string::npos;
|
||||
auto transportIsFile = parseUrlScheme(scheme).transport == "file";
|
||||
|
||||
if (authority && *authority != "" && isFile)
|
||||
if (authority && *authority != "" && transportIsFile)
|
||||
throw BadURL("file:// URL '%s' has unexpected authority '%s'",
|
||||
url, *authority);
|
||||
|
||||
if (isFile && path.empty())
|
||||
if (transportIsFile && path.empty())
|
||||
path = "/";
|
||||
|
||||
return ParsedURL{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue