mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-26 12:24:46 +00:00
Code improvement
This commit is contained in:
1 parent
2d8e49dd9b
commit
acd0640870
1 file changed
+3
-3
@@ -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
|
// path, query or fragment delimiter (or the end of input). Otherwise the
|
||||||
// trailing bytes would be folded into the path while the connection
|
// trailing bytes would be folded into the path while the connection
|
||||||
// still targets the bracketed address.
|
// still targets the bracketed address.
|
||||||
if (pos < url.size() && url[pos] != ':' && url[pos] != '/' &&
|
if (pos < url.size()) {
|
||||||
url[pos] != '?' && url[pos] != '#') {
|
auto c = url[pos];
|
||||||
return false;
|
if (c != ':' && c != '/' && c != '?' && c != '#') { return false; }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
auto end = url.find_first_of(":/?#", pos);
|
auto end = url.find_first_of(":/?#", pos);
|
||||||
|
|||||||
Reference in new issue
Block a user