Changeset 228930 in webkit
- Timestamp:
- Feb 22, 2018 12:42:54 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r228929 r228930 1 2018-02-22 Youenn Fablet <youenn@apple.com> 2 3 Fetch event release assert should take into account the fetch mode 4 https://bugs.webkit.org/show_bug.cgi?id=183047 5 6 Reviewed by Chris Dumez. 7 8 In case of navigation tasks, we should use the request URL and not the origin of the loading client. 9 10 * WebProcess/Storage/WebSWContextManagerConnection.cpp: 11 (WebKit::isValidFetch): 12 (WebKit::WebSWContextManagerConnection::startFetch): 13 1 14 2018-02-22 Yousuke Kimoto <yousuke.kimoto@sony.com> 2 15 -
trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp
r228919 r228930 181 181 } 182 182 183 static inline bool isValidFetch(const ResourceRequest& request, const FetchOptions& options, const URL& serviceWorkerURL, const String& referrer) 184 { 185 // For exotic service workers, do not enforce checks. 186 if (!serviceWorkerURL.protocolIsInHTTPFamily()) 187 return true; 188 189 if (options.mode == FetchOptions::Mode::Navigate) 190 return protocolHostAndPortAreEqual(request.url(), serviceWorkerURL); 191 192 String origin = request.httpOrigin(); 193 URL url { URL(), origin.isEmpty() ? referrer : origin }; 194 if (!url.protocolIsInHTTPFamily()) 195 return true; 196 197 return protocolHostAndPortAreEqual(url, serviceWorkerURL); 198 } 199 183 200 void WebSWContextManagerConnection::startFetch(SWServerConnectionIdentifier serverConnectionIdentifier, uint64_t fetchIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier, ResourceRequest&& request, FetchOptions&& options, IPC::FormDataReference&& formData, String&& referrer) 184 201 { … … 189 206 } 190 207 191 String origin = request.httpOrigin(); 192 URL url { URL(), origin.isEmpty() ? referrer : origin }; 193 URL serviceWorkerURL = serviceWorkerThreadProxy->scriptURL(); 194 RELEASE_ASSERT(!url.protocolIsInHTTPFamily() || !serviceWorkerURL.protocolIsInHTTPFamily() || protocolHostAndPortAreEqual(url, serviceWorkerURL)); 208 RELEASE_ASSERT(isValidFetch(request, options, serviceWorkerThreadProxy->scriptURL(), referrer)); 195 209 196 210 auto client = WebServiceWorkerFetchTaskClient::create(m_connectionToStorageProcess.copyRef(), serviceWorkerIdentifier, serverConnectionIdentifier, fetchIdentifier);
Note: See TracChangeset
for help on using the changeset viewer.