WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-175280-20170807130331.patch (text/plain), 3.24 KB, created by
Chris Dumez
on 2017-08-07 13:03:31 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2017-08-07 13:03:31 PDT
Size:
3.24 KB
patch
obsolete
>Subversion Revision: 220333 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index fde91d15afadcda41d161b027001ae95d2d65775..b070e4c55dbe846358d3f3c93ae363cf9b2ae954 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2017-08-07 Chris Dumez <cdumez@apple.com> >+ >+ Update sendBeacon() to rely on FetchBody instead of the whole FetchRequest >+ https://bugs.webkit.org/show_bug.cgi?id=175280 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update sendBeacon() to rely on FetchBody instead of the whole FetchRequest. FetchBody >+ for data destruction is really the only thing we need at the moment. >+ The new code also properly sets the CORS mode, which will be needed for Bug 175264. >+ >+ * Modules/beacon/NavigatorBeacon.cpp: >+ (WebCore::NavigatorBeacon::sendBeacon): >+ > 2017-08-07 Antti Koivisto <antti@apple.com> > > REGRESSION (r219121): Airmail 3 prints header part only. >diff --git a/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp b/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp >index 7208bcc81d48a56155fc1238b72c72a1378be1f2..394344d6a5fd16443850096555af49afcabae6fb 100644 >--- a/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp >+++ b/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp >@@ -28,7 +28,8 @@ > > #include "CachedResourceLoader.h" > #include "Document.h" >-#include "FetchRequest.h" >+#include "FetchBody.h" >+#include "HTTPParsers.h" > #include "Navigator.h" > #include "URL.h" > #include <runtime/JSCJSValue.h> >@@ -55,21 +56,26 @@ ExceptionOr<bool> NavigatorBeacon::sendBeacon(Navigator&, Document& document, co > return true; > } > >- FetchRequestInit init; >- init.method = ASCIILiteral("POST"); >- init.body = WTFMove(body); >- init.credentials = FetchOptions::Credentials::Include; >- init.cache = FetchOptions::Cache::NoCache; >- init.redirect = FetchOptions::Redirect::Follow; >- init.keepalive = true; >- init.window = JSC::jsNull(); >+ ResourceRequest request(parsedUrl); >+ request.setHTTPMethod(ASCIILiteral("POST")); > >- auto fetchRequestResult = FetchRequest::create(document, parsedUrl.string(), WTFMove(init)); >- if (fetchRequestResult.hasException()) >- return fetchRequestResult.releaseException(); >- >- auto fetchRequest = fetchRequestResult.releaseReturnValue(); >- document.cachedResourceLoader().requestBeaconResource({ fetchRequest->internalRequest(), fetchRequest->fetchOptions() }); >+ FetchOptions options; >+ options.credentials = FetchOptions::Credentials::Include; >+ options.redirect = FetchOptions::Redirect::Follow; >+ options.cache = FetchOptions::Cache::NoCache; >+ options.keepAlive = true; >+ if (body) { >+ options.mode = FetchOptions::Mode::Cors; >+ String mimeType; >+ auto fetchBody = FetchBody::extract(document, WTFMove(body.value()), mimeType); >+ request.setHTTPBody(fetchBody.bodyForInternalRequest(document)); >+ if (!mimeType.isEmpty()) { >+ request.setHTTPContentType(mimeType); >+ if (isCrossOriginSafeRequestHeader(HTTPHeaderName::ContentType, mimeType)) >+ options.mode = FetchOptions::Mode::NoCors; >+ } >+ } >+ document.cachedResourceLoader().requestBeaconResource({ WTFMove(request), options }); > return true; > } >
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 175280
:
317454
|
317463
|
317480
|
317482