Fix URL parser

Fixes #3361.
This commit is contained in:
Eelco Dolstra 2020-02-18 12:51:26 +01:00
parent 6529490cc1
commit b5e3c04c03
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -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<std::string>(match[5]) : std::nullopt;
auto authority = match[3].matched
? std::optional<std::string>(match[3]) : std::nullopt;
std::string path = match[4].matched ? match[4] : match[5];
auto & query = match[6];
auto & fragment = match[7];