From: pojomi Date: Sun, 4 Jan 2026 20:50:27 +0000 (-0500) Subject: config2setopts: add space in cookie header with multiple -b X-Git-Tag: curl-8_18_0~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc739fee166d3012e612d7a1fb2952840dd252b1;p=thirdparty%2Fcurl.git config2setopts: add space in cookie header with multiple -b Closes #20184 --- diff --git a/src/config2setopts.c b/src/config2setopts.c index 6ecabe5cc8..d462e8cd54 100644 --- a/src/config2setopts.c +++ b/src/config2setopts.c @@ -547,8 +547,8 @@ static CURLcode cookie_setopts(struct OperationConfig *config, CURL *curl) if(cl == config->cookies) result = curlx_dyn_add(&cookies, cl->data); else - result = curlx_dyn_addf(&cookies, ";%s", cl->data); - + result = curlx_dyn_addf(&cookies, ";%s%s", + ISBLANK(cl->data[0]) ? "" : " ", cl->data); if(result) { warnf("skipped provided cookie, the cookie header " "would go over %u bytes", MAX_COOKIE_LINE); diff --git a/tests/data/test6 b/tests/data/test6 index 557c6eda8f..5f1d096d26 100644 --- a/tests/data/test6 +++ b/tests/data/test6 @@ -44,7 +44,7 @@ GET /we/want/that/page/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* -Cookie: name=contents;name2=content2;name3=content3 +Cookie: name=contents;name2=content2; name3=content3