From b5e3c04c0364abf91550b043df975272bfeecb9e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 18 Feb 2020 12:51:26 +0100 Subject: [PATCH] Fix URL parser Fixes #3361. --- src/libstore/fetchers/parse.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstore/fetchers/parse.cc b/src/libstore/fetchers/parse.cc index 4f7cb3c6b..a5ad14c87 100644 --- a/src/libstore/fetchers/parse.cc +++ b/src/libstore/fetchers/parse.cc @@ -22,8 +22,8 @@ ParsedURL parseURL(const std::string & url) if (std::regex_match(url, match, uriRegex)) { auto & base = match[1]; std::string scheme = match[2]; - auto authority = match[4].matched - ? std::optional(match[5]) : std::nullopt; + auto authority = match[3].matched + ? std::optional(match[3]) : std::nullopt; std::string path = match[4].matched ? match[4] : match[5]; auto & query = match[6]; auto & fragment = match[7];