Changeset 227964 in webkit
- Timestamp:
- Feb 1, 2018 7:53:42 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r227963 r227964 1 2018-02-01 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [SOUP] Ensure domain is valid when converting a WebCore Cookie to Soup 4 https://bugs.webkit.org/show_bug.cgi?id=182328 5 6 Reviewed by Michael Catanzaro. 7 8 soup_cookie_parse() adds the initial '.' to the domain if missing before creating the SoupCookie, but 9 soup_cookie_new() allows for domain to be a hostname that needs to match exactly. When converting a WebCore 10 Cookie into a SoupCookie we always want the domain to be considered as such and not as a hostname, so we need to 11 prepend the '.' if missing. 12 13 Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie 14 15 * platform/network/soup/CookieSoup.cpp: 16 (WebCore::Cookie::toSoupCookie const): 17 1 18 2018-02-01 Zalan Bujtas <zalan@apple.com> 2 19 -
trunk/Source/WebCore/platform/network/soup/CookieSoup.cpp
r225054 r227964 61 61 return nullptr; 62 62 63 // soup_cookie_new() will handle the given domain as a hostname if it doesn't start with '.'. 64 auto cookieDomain = domain.utf8(); 65 if (cookieDomain.length() && !g_hostname_is_ip_address(cookieDomain.data()) && cookieDomain.data()[0] != '.') 66 cookieDomain = makeString('.', domain).utf8(); 67 63 68 SoupCookie* soupCookie = soup_cookie_new(name.utf8().data(), value.utf8().data(), 64 domain.utf8().data(), path.utf8().data(), -1);69 cookieDomain.data(), path.utf8().data(), -1); 65 70 66 71 soup_cookie_set_http_only(soupCookie, httpOnly);
Note: See TracChangeset
for help on using the changeset viewer.