decodeQuery Take std::string_view not string ref

(cherry picked from commit 4083eff0c0)
This commit is contained in:
John Ericson committed 2025-08-23 12:02:56 -04:00
1 parent f777aa70d3
commit 752d0ef1c0
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -82,7 +82,7 @@ std::pair<FlakeRef, std::string> parsePathFlakeRefWithFragment(
auto succeeds = std::regex_match(url, match, pathFlakeRegex);
assert(succeeds);
auto path = match[1].str();
auto query = decodeQuery(match[3]);
auto query = decodeQuery(match[3].str());
auto fragment = percentDecode(match[5].str());
if (baseDir) {
+2 -2
View File
@@ -179,7 +179,7 @@ try {
.scheme = scheme,
.authority = authority,
.path = path,
.query = decodeQuery(std::string(query)),
.query = decodeQuery(query),
.fragment = fragment,
};
} catch (boost::system::system_error & e) {
@@ -201,7 +201,7 @@ std::string percentEncode(std::string_view s, std::string_view keep)
s, [keep](char c) { return boost::urls::unreserved_chars(c) || keep.find(c) != keep.npos; });
}
StringMap decodeQuery(const std::string & query)
StringMap decodeQuery(std::string_view query)
try {
/* For back-compat unescaped characters are allowed. */
auto fixedEncodedQuery = percentEncodeCharSet(query, extraAllowedCharsInQuery);