Changeset 258599 in webkit
- Timestamp:
- Mar 17, 2020 2:35:28 PM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r258588 r258599 1 2020-03-17 John Wilander <wilander@apple.com> 2 3 Add quirk for cookie blocking latch mode ymail.com redirecting to yahoo.com under yahoo.com 4 https://bugs.webkit.org/show_bug.cgi?id=209193 5 <rdar://problem/60089022> 6 7 Reviewed by Brent Fulgham. 8 9 No new tests. Site-specific quirk tested manually on the site in question. 10 11 * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: 12 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: 13 (WebKit::NetworkDataTaskCocoa::unblockCookies): 14 (WebKit::NetworkDataTaskCocoa::needsFirstPartyCookieBlockingLatchModeQuirk const): 15 (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): 16 1 17 2020-03-17 Brian Burg <bburg@apple.com> 2 18 -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h
r257185 r258599 87 87 static NSHTTPCookieStorage *statelessCookieStorage(); 88 88 void blockCookies(); 89 void unblockCookies(); 90 bool needsFirstPartyCookieBlockingLatchModeQuirk(const URL& firstPartyURL, const URL& requestURL, const URL& redirectingURL) const; 89 91 #endif 90 92 bool isThirdPartyRequest(const WebCore::ResourceRequest&) const; -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm
r257762 r258599 151 151 [m_task _setExplicitCookieStorage:statelessCookieStorage()._cookieStorage]; 152 152 m_hasBeenSetToUseStatelessCookieStorage = true; 153 } 154 155 void NetworkDataTaskCocoa::unblockCookies() 156 { 157 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanAccessRawCookies)); 158 159 if (!m_hasBeenSetToUseStatelessCookieStorage) 160 return; 161 162 if (auto* storageSession = m_session->networkStorageSession()) { 163 [m_task _setExplicitCookieStorage:storageSession->nsCookieStorage()._cookieStorage]; 164 m_hasBeenSetToUseStatelessCookieStorage = false; 165 } 166 } 167 168 // FIXME: Temporary fix for <rdar://problem/60089022> until content can be updated. 169 bool NetworkDataTaskCocoa::needsFirstPartyCookieBlockingLatchModeQuirk(const URL& firstPartyURL, const URL& requestURL, const URL& redirectingURL) const 170 { 171 using RegistrableDomain = WebCore::RegistrableDomain; 172 static NeverDestroyed<HashMap<RegistrableDomain, RegistrableDomain>> quirkPairs = [] { 173 HashMap<RegistrableDomain, RegistrableDomain> map; 174 map.add(RegistrableDomain::uncheckedCreateFromRegistrableDomainString("ymail.com"_s), RegistrableDomain::uncheckedCreateFromRegistrableDomainString("yahoo.com"_s)); 175 return map; 176 }(); 177 178 RegistrableDomain firstPartyDomain { firstPartyURL }; 179 RegistrableDomain requestDomain { requestURL }; 180 if (firstPartyDomain != requestDomain) 181 return false; 182 183 RegistrableDomain redirectingDomain { redirectingURL }; 184 auto quirk = quirkPairs.get().find(redirectingDomain); 185 if (quirk == quirkPairs.get().end()) 186 return false; 187 188 return quirk->value == requestDomain; 153 189 } 154 190 #endif … … 388 424 || (m_session->networkStorageSession() && m_session->networkStorageSession()->shouldBlockCookies(request, m_frameID, m_pageID))) 389 425 blockCookies(); 390 } 426 } else if (m_storedCredentialsPolicy != WebCore::StoredCredentialsPolicy::EphemeralStateless && needsFirstPartyCookieBlockingLatchModeQuirk(request.firstPartyForCookies(), request.url(), redirectResponse.url())) 427 unblockCookies(); 391 428 #if !RELEASE_LOG_DISABLED 392 429 if (m_session->shouldLogCookieInformation())
Note: See TracChangeset
for help on using the changeset viewer.