← Commit list

4f6aa41a01

Daniel Stenberg
Daniel Stenberg
2026-08-27
SUCCESS Duration: 397s

Subject

cookie: improve TAB handling

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/cookie.c+1 -1
@@ -611,7 +611,7 @@ parse_cookie_header(struct Curl_easy *data,
struct Curl_str name;
/* we have a <name>=<value> pair or a stand-alone word here */
- if(!curlx_str_cspn(&ptr, &name, ";\t\r\n=")) {
+ if(!curlx_str_cspn(&ptr, &name, ";\r\n=")) {
struct Curl_str val;
bool sep = FALSE;
curlx_str_trimblanks(&name);
tests/data/Makefile.am+1 -1
@@ -1997,7 +1997,7 @@ TESTCASES = \
test2721 \
test2722 \
test2723 \
- \
+ test2885 \
test3000 \
test3001 \
test3002 \
tests/data/test2885+52 -0
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<testcase>
+<info>
+<keywords>
+HTTP
+cookies
+</keywords>
+</info>
+
+<reply>
+<data crlf="headers">
+HTTP/1.1 200 OK
+Content-Length: 0
+Set-Cookie: thisis=SECRET;%TABSecure
+Set-Cookie: also=notab; Secure
+
+</data>
+</reply>
+
+<client>
+<features>
+cookies
+</features>
+<server>
+https
+</server>
+<name>
+Cookies with TAB before 'secure'
+</name>
+<command>
+https://cookie.example:%HTTPSPORT/%TESTNUMBER -c %LOGDIR/cookies.txt --resolve cookie.example:%HTTPSPORT:%HOSTIP --insecure
+</command>
+</client>
+
+<verify>
+<protocol crlf="headers">
+GET /%TESTNUMBER HTTP/1.1
+Host: cookie.example:%HTTPSPORT
+User-Agent: curl/%VERSION
+Accept: */*
+
+</protocol>
+<file name="%LOGDIR/cookies.txt" mode="text">
+# Netscape HTTP Cookie File
+# https://curl.se/docs/http-cookies.html
+# This file was generated by libcurl! Edit at your own risk.
+
+cookie.example%TABFALSE%TAB/%TABTRUE%TAB0%TABalso%TABnotab
+cookie.example%TABFALSE%TAB/%TABTRUE%TAB0%TABthisis%TABSECRET
+</file>
+</verify>
+</testcase>