wininet: Ignore unknown attributes in get_cookie.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2016-06-20 21:32:48 +02:00 committed by Alexandre Julliard
parent 3a7bd03da0
commit 0d9dcf5c8f
2 changed files with 5 additions and 2 deletions

View File

@ -911,6 +911,7 @@ DWORD set_cookie(substr_t domain, substr_t path, substr_t name, substr_t data, D
static const WCHAR szSecure[] = {'s','e','c','u','r','e'}; static const WCHAR szSecure[] = {'s','e','c','u','r','e'};
static const WCHAR szHttpOnly[] = {'h','t','t','p','o','n','l','y'}; static const WCHAR szHttpOnly[] = {'h','t','t','p','o','n','l','y'};
static const WCHAR szVersion[] = {'v','e','r','s','i','o','n','='}; static const WCHAR szVersion[] = {'v','e','r','s','i','o','n','='};
static const WCHAR max_ageW[] = {'m','a','x','-','a','g','e','='};
/* Skip ';' */ /* Skip ';' */
if(data.len) if(data.len)
@ -976,9 +977,11 @@ DWORD set_cookie(substr_t domain, substr_t path, substr_t name, substr_t data, D
substr_skip(&data, len); substr_skip(&data, len);
FIXME("version not handled (%s)\n",debugstr_wn(data.str, data.len)); FIXME("version not handled (%s)\n",debugstr_wn(data.str, data.len));
}else if(data.len >= (len = sizeof(max_ageW)/sizeof(WCHAR)) && !strncmpiW(data.str, max_ageW, len)) {
/* Native doesn't support Max-Age attribute. */
WARN("Max-Age ignored\n");
}else if(data.len) { }else if(data.len) {
FIXME("Unknown additional option %s\n", debugstr_wn(data.str, data.len)); FIXME("Unknown additional option %s\n", debugstr_wn(data.str, data.len));
break;
} }
substr_skip(&data, end_ptr - data.str); substr_skip(&data, end_ptr - data.str);

View File

@ -388,7 +388,7 @@ static void test_complicated_cookie(void)
/* Technically illegal! domain should require 2 dots, but native wininet accepts it */ /* Technically illegal! domain should require 2 dots, but native wininet accepts it */
ret = InternetSetCookieA("http://www.example.com",NULL,"E=F; domain=example.com"); ret = InternetSetCookieA("http://www.example.com",NULL,"E=F; domain=example.com");
ok(ret == TRUE,"InternetSetCookie failed\n"); ok(ret == TRUE,"InternetSetCookie failed\n");
ret = InternetSetCookieA("http://www.example.com",NULL,"G=H; domain=.example.com; path=/foo"); ret = InternetSetCookieA("http://www.example.com",NULL,"G=H; domain=.example.com; invalid=attr; path=/foo");
ok(ret == TRUE,"InternetSetCookie failed\n"); ok(ret == TRUE,"InternetSetCookie failed\n");
ret = InternetSetCookieA("http://www.example.com/bar.html",NULL,"I=J; domain=.example.com"); ret = InternetSetCookieA("http://www.example.com/bar.html",NULL,"I=J; domain=.example.com");
ok(ret == TRUE,"InternetSetCookie failed\n"); ok(ret == TRUE,"InternetSetCookie failed\n");