-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Fixed missing space in cookie header when using multiple -b flags #20184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Analysis of PR #20184 at b0b09591: Test 6 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Note that this test has failed in 644 different CI jobs (the link just goes to one of them). Test 2500 failed, but it has been 32.1% flaky lately, so it's probably NOT a fault of the PR. Note that this test has failed in 4 different CI jobs (the link just goes to one of them). Note that this CI job has had a number of other flaky tests recently (3, to be exact) so it may be that this failure is rather a systemic issue with this job and not with this specific PR. Generated by Testclutch |
|
Isn't it enough to just: @@ -545,11 +545,12 @@ static CURLcode cookie_setopts(struct OperationConfig *config, CURL *curl)
curlx_dyn_init(&cookies, MAX_COOKIE_LINE);
for(cl = config->cookies; cl; cl = cl->next) {
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);
return result; |
@bagder |
I think we should let the user's data be passed in as-is. |
You're right. Simplified to only resolve the issue reported. |
|
Thanks! |
Thank you for approving my first PR! More to come. |
Summary
When using multiple
-bflags, the Cookie header was missing a space after the semicolon separator.Bug behavior
Produced:
Cookie: a=b;c=d(missing space)Expected behavior
Should produce:
Cookie: a=b; c=d(space after semicolon)Fix
Changed the format string in
src/config2setopts.cline 550 from";%s"to"; %s"to include the space separator as per HTTP cookie header specifications.Testing
Verified with:
Now correctly outputs:
Cookie: a=b; c=dFixes #20183 #20182