Module: wine Branch: master Commit: 0d9dcf5c8f97bf86790d9a49b2e65441622de2a2 URL: http://source.winehq.org/git/wine.git/?a=commit;h=0d9dcf5c8f97bf86790d9a49b2...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Jun 20 21:32:48 2016 +0200
wininet: Ignore unknown attributes in get_cookie.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wininet/cookie.c | 5 ++++- dlls/wininet/tests/internet.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/wininet/cookie.c b/dlls/wininet/cookie.c index 5de2304..38f69e0 100644 --- a/dlls/wininet/cookie.c +++ b/dlls/wininet/cookie.c @@ -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 szHttpOnly[] = {'h','t','t','p','o','n','l','y'}; static const WCHAR szVersion[] = {'v','e','r','s','i','o','n','='}; + static const WCHAR max_ageW[] = {'m','a','x','-','a','g','e','='};
/* Skip ';' */ 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);
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) { FIXME("Unknown additional option %s\n", debugstr_wn(data.str, data.len)); - break; }
substr_skip(&data, end_ptr - data.str); diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c index db662a2..9b0a2e7 100644 --- a/dlls/wininet/tests/internet.c +++ b/dlls/wininet/tests/internet.c @@ -388,7 +388,7 @@ static void test_complicated_cookie(void) /* Technically illegal! domain should require 2 dots, but native wininet accepts it */ ret = InternetSetCookieA("http://www.example.com%22,NULL,%22E=F; domain=example.com"); ok(ret == TRUE,"InternetSetCookie failed\n"); - ret = InternetSetCookieA("http://www.example.com%22,NULL,%22G=H; domain=.example.com; path=/foo"); + ret = InternetSetCookieA("http://www.example.com%22,NULL,%22G=H; domain=.example.com; invalid=attr; path=/foo"); ok(ret == TRUE,"InternetSetCookie failed\n"); ret = InternetSetCookieA("http://www.example.com/bar.html%22,NULL,%22I=J; domain=.example.com"); ok(ret == TRUE,"InternetSetCookie failed\n");