From: Alex Date: Sun, 26 Nov 2023 02:01:25 +0000 (+0000) Subject: Simplify urlIsRelative() code (#1595) X-Git-Tag: SQUID_7_0_1~276 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a226c967b51fba5c3af4b8df5f21c55f9fa19f2a;p=thirdparty%2Fsquid.git Simplify urlIsRelative() code (#1595) --- diff --git a/src/anyp/Uri.cc b/src/anyp/Uri.cc index 152c86aff8..2f9a7191f4 100644 --- a/src/anyp/Uri.cc +++ b/src/anyp/Uri.cc @@ -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) {