Commit ca0c548c authored by Pierre Ynard's avatar Pierre Ynard

http: supersede domainless cookies

The scope of cookies without a domain is limited to the current server.
The current logic is always wrong because either it's the same server
and the new cookie should supersede the old one, or it's a different
server and the old cookie should not be sent. This logic is still far
from RFC-compliant, but at least it should get it right some of the time.
parent 34b0c609
......@@ -1720,8 +1720,10 @@ static void cookie_append( vlc_array_t * cookies, char * cookie )
assert( current_cookie_name );
bool is_domain_matching = ( cookie_domain && current_cookie_domain &&
!strcmp( cookie_domain, current_cookie_domain ) );
bool is_domain_matching = (
( !cookie_domain && !current_cookie_domain ) ||
( cookie_domain && current_cookie_domain &&
!strcmp( cookie_domain, current_cookie_domain ) ) );
if( is_domain_matching && !strcmp( cookie_name, current_cookie_name ) )
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment