]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Simplify urlIsRelative() code (#1595)
authorAlex <bigalex934@gmail.com>
Sun, 26 Nov 2023 02:01:25 +0000 (02:01 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 26 Nov 2023 02:01:33 +0000 (02:01 +0000)
src/anyp/Uri.cc

index 152c86aff89b2e72c7274e5db5012de7454db778..2f9a7191f41ad801fe7a733769fd3f1ebbf6ff03 100644 (file)
@@ -775,12 +775,9 @@ urlIsRelative(const char *url)
         return true; // path-empty
 
     if (*url == '/') {
-        // RFC 3986 section 5.2.3
-        // path-absolute   ; begins with "/" but not "//"
-        if (url[1] == '/')
-            return true; // network-path reference, aka. 'scheme-relative URI'
-        else
-            return true; // path-absolute, aka 'absolute-path reference'
+        // network-path reference (a.k.a. 'scheme-relative URI') or
+        // path-absolute (a.k.a. 'absolute-path reference')
+        return true;
     }
 
     for (const auto *p = url; *p != '\0' && *p != '/' && *p != '?' && *p != '#'; ++p) {