Code improvement

This commit is contained in:
yhirose
2026-08-14 21:29:14 -04:00
parent 2d8e49dd9b
commit acd0640870
+3 -3
View File
@@ -856,9 +856,9 @@ inline bool parse_url(const std::string &url, UrlComponents &uc) {
// path, query or fragment delimiter (or the end of input). Otherwise the
// trailing bytes would be folded into the path while the connection
// still targets the bracketed address.
if (pos < url.size() && url[pos] != ':' && url[pos] != '/' &&
url[pos] != '?' && url[pos] != '#') {
return false;
if (pos < url.size()) {
auto c = url[pos];
if (c != ':' && c != '/' && c != '?' && c != '#') { return false; }
}
} else {
auto end = url.find_first_of(":/?#", pos);