Jacky Lam cookie parser fix for domains with preceeding dot

This commit is contained in:
Daniel Stenberg 2002-03-25 09:08:33 +00:00
Родитель 5af61716aa
Коммит 541e5a3b82
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -347,7 +347,13 @@ Curl_cookie_add(struct CookieInfo *c,
/* the names are identical */
if(clist->domain && co->domain) {
if(strequal(clist->domain, co->domain))
if(strequal(clist->domain, co->domain) ||
(clist->domain[0]=='.' &&
strequal(&(clist->domain[1]), co->domain)) ||
(co->domain[0]=='.' &&
strequal(clist->domain, &(co->domain[1]))) )
/* The domains are identical, or at least identical if you skip the
preceeding dot */
replace_old=TRUE;
}
else if(!clist->domain && !co->domain)