WebKit Bugzilla
Attachment 347192 Details for
Bug 188609
: [Curl] Implement default cookie path handling correctly as outlined in RFC6265.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
PATCH
188609.diff (text/plain), 4.67 KB, created by
Basuke Suzuki
on 2018-08-15 12:17:00 PDT
(
hide
)
Description:
PATCH
Filename:
MIME Type:
Creator:
Basuke Suzuki
Created:
2018-08-15 12:17:00 PDT
Size:
4.67 KB
patch
obsolete
>diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index ee74960aa01..a10a4674b67 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2018-08-15 Basuke Suzuki <Basuke.Suzuki@sony.com> >+ >+ [Curl] Implement default cookie path handling correctly as outlined in RFC6265. >+ https://bugs.webkit.org/show_bug.cgi?id=188609 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Curl implementation of default cookie path was wrong so that some cookies cannot be accessible. >+ It should be generated as outlined in: https://tools.ietf.org/html/rfc6265#section-5.1.4 >+ >+ * platform/wincairo/TestExpectations: >+ - http/tests/cookies/http-get-cookie-set-in-js.html [ Pass ] >+ >+ > 2018-08-14 Antoine Quint <graouts@apple.com> > > [Web Animations] Crash under AnimationTimeline::cancelOrRemoveDeclarativeAnimation() >diff --git a/LayoutTests/platform/wincairo/TestExpectations b/LayoutTests/platform/wincairo/TestExpectations >index 87e1bbcbc9d..f96e9c2e889 100644 >--- a/LayoutTests/platform/wincairo/TestExpectations >+++ b/LayoutTests/platform/wincairo/TestExpectations >@@ -859,7 +859,6 @@ http/tests/contentfiltering [ Skip ] > http/tests/cookies/same-site [ Skip ] > > http/tests/cookies/double-quoted-value-with-semi-colon.html [ Failure ] >-http/tests/cookies/http-get-cookie-set-in-js.html [ Failure ] > http/tests/cookies/multiple-cookies.html [ Failure ] > http/tests/cookies/private-cookie-storage.html [ Crash ] > http/tests/cookies/simple-cookies-expired.html [ Failure ] >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index af596853ede..5e9beeb0046 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2018-08-15 Basuke Suzuki <Basuke.Suzuki@sony.com> >+ >+ [Curl] Implement default cookie path handling correctly as outlined in RFC6265. >+ https://bugs.webkit.org/show_bug.cgi?id=188609 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Curl implementation of default cookie path was wrong so that some cookies cannot be accessible. >+ It should be generated as outlined in: https://tools.ietf.org/html/rfc6265#section-5.1.4 >+ >+ Tests: http/tests/cookies/http-get-cookie-set-in-js.html >+ >+ * platform/network/curl/CookieJarDB.cpp: >+ (WebCore::CookieJarDB::setCookie): >+ * platform/network/curl/CookieUtil.cpp: >+ (WebCore::CookieUtil::defaultPathForURL): >+ * platform/network/curl/CookieUtil.h: >+ > 2018-08-14 Ali Juma <ajuma@chromium.org> > > Follow-up: [IntersectionObserver] Implement rootMargin parsing >diff --git a/Source/WebCore/platform/network/curl/CookieJarDB.cpp b/Source/WebCore/platform/network/curl/CookieJarDB.cpp >index 13f15fc8ff6..0da5d1c7a1c 100644 >--- a/Source/WebCore/platform/network/curl/CookieJarDB.cpp >+++ b/Source/WebCore/platform/network/curl/CookieJarDB.cpp >@@ -393,7 +393,7 @@ int CookieJarDB::setCookie(const String& url, const String& cookie, bool fromJav > cookieObj.domain = String(host); > > if (cookieObj.path.isEmpty()) >- cookieObj.path = String(path); >+ cookieObj.path = CookieUtil::defaultPathForURL(urlObj); > > // FIXME: Need to check that a domain doesn't a set cookie for a tld when wincairo supports PSL > >diff --git a/Source/WebCore/platform/network/curl/CookieUtil.cpp b/Source/WebCore/platform/network/curl/CookieUtil.cpp >index 94952652056..cf55884826f 100644 >--- a/Source/WebCore/platform/network/curl/CookieUtil.cpp >+++ b/Source/WebCore/platform/network/curl/CookieUtil.cpp >@@ -177,6 +177,21 @@ bool parseCookieHeader(const String& cookieLine, const String& domain, Cookie& r > return true; > } > >+String defaultPathForURL(const URL& url) >+{ >+ // Algorithm to generate the default path is outlined in https://tools.ietf.org/html/rfc6265#section-5.1.4 >+ >+ String path = url.path(); >+ if (path.isEmpty() || !path.startsWith('/')) >+ return "/"; >+ >+ auto lastSlashPosition = path.reverseFind('/'); >+ if (!lastSlashPosition) >+ return "/"; >+ >+ return path.substring(0, lastSlashPosition); >+} >+ > } // namespace CookieUtil > > } // namespace WebCore >diff --git a/Source/WebCore/platform/network/curl/CookieUtil.h b/Source/WebCore/platform/network/curl/CookieUtil.h >index 267fdc29a2d..a89c9ab7b96 100644 >--- a/Source/WebCore/platform/network/curl/CookieUtil.h >+++ b/Source/WebCore/platform/network/curl/CookieUtil.h >@@ -24,7 +24,9 @@ > > #pragma once > >+#include "URL.h" > #include <wtf/Forward.h> >+#include <wtf/text/WTFString.h> > > namespace WebCore { > >@@ -38,6 +40,8 @@ bool isIPAddress(const String& hostname); > > bool domainMatch(const String& cookieDomain, const String& host); > >+WEBCORE_EXPORT String defaultPathForURL(const URL&); >+ > } // namespace CookieUtil > > } // namespace WebCore
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188609
:
347192
|
347196