mirror of
https://github.com/curl/curl.git
synced 2026-08-25 07:23:31 +03:00
cookies: leave secure cookies alone
Only allow secure origins to be able to write cookies with the 'secure' flag set. This reduces the risk of non-secure origins to influence the state of secure origins. This implements IETF Internet-Draft draft-ietf-httpbis-cookie-alone-01 which updates RFC6265. Closes #2956 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
This commit is contained in:
parent
fdc5563b6e
commit
7a09b52c98
11 changed files with 148 additions and 43 deletions
|
|
@ -803,12 +803,12 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option,
|
|||
if(checkprefix("Set-Cookie:", argptr))
|
||||
/* HTTP Header format line */
|
||||
Curl_cookie_add(data, data->cookies, TRUE, FALSE, argptr + 11, NULL,
|
||||
NULL);
|
||||
NULL, TRUE);
|
||||
|
||||
else
|
||||
/* Netscape format line */
|
||||
Curl_cookie_add(data, data->cookies, FALSE, FALSE, argptr, NULL,
|
||||
NULL);
|
||||
NULL, TRUE);
|
||||
|
||||
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
|
||||
free(argptr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue