Skip to content

Commit dd6d102

Browse files
committed
Merge branch 'jc/http-cookiefile'
The http.cookieFile and http.saveCookies configuration variables have a few values that need to be avoided, which are now ignored with warning messages. * jc/http-cookiefile: http.c: cookie file tightening
2 parents b19a8c0 + 4f58220 commit dd6d102

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

http.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,16 @@ struct active_request_slot *get_active_slot(void)
15091509
slot->finished = NULL;
15101510
slot->callback_data = NULL;
15111511
slot->callback_func = NULL;
1512+
1513+
if (curl_cookie_file && !strcmp(curl_cookie_file, "-")) {
1514+
warning(_("refusing to read cookies from http.cookiefile '-'"));
1515+
FREE_AND_NULL(curl_cookie_file);
1516+
}
15121517
curl_easy_setopt(slot->curl, CURLOPT_COOKIEFILE, curl_cookie_file);
1518+
if (curl_save_cookies && (!curl_cookie_file || !curl_cookie_file[0])) {
1519+
curl_save_cookies = 0;
1520+
warning(_("ignoring http.savecookies for empty http.cookiefile"));
1521+
}
15131522
if (curl_save_cookies)
15141523
curl_easy_setopt(slot->curl, CURLOPT_COOKIEJAR, curl_cookie_file);
15151524
curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, pragma_header);

0 commit comments

Comments
 (0)