]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cookie: do prefix matching case-sensitively
authorDaniel Stenberg <daniel@haxx.se>
Wed, 26 Feb 2025 06:54:15 +0000 (07:54 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 26 Feb 2025 07:33:49 +0000 (08:33 +0100)
According to section 4.1.3.1 and 4.1.3.2 of
draft-ietf-httpbis-rfc6265bis-19

Ref: https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis-19#section-4.1.3.1

Closes #16494

lib/cookie.c

index 9ef7375327683da63af7db10a8bc4a882bef07f9..519fcdc4af19c6e53b0cead30171a4a7cf907f82 100644 (file)
@@ -536,9 +536,9 @@ parse_cookie_header(struct Curl_easy *data,
        * "the rest". Prefixes must start with '__' and end with a '-', so
        * only test for names where that can possibly be true.
        */
-      if(strncasecompare("__Secure-", Curl_str(&name), 9))
+      if(!strncmp("__Secure-", Curl_str(&name), 9))
         co->prefix_secure = TRUE;
-      else if(strncasecompare("__Host-", Curl_str(&name), 7))
+      else if(!strncmp("__Host-", Curl_str(&name), 7))
         co->prefix_host = TRUE;
 
       /*