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-236837-20220224094923.patch (text/plain), 4.70 KB, created by
youenn fablet
on 2022-02-24 00:49:24 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2022-02-24 00:49:24 PST
Size:
4.70 KB
patch
obsolete
>Subversion Revision: 290366 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2a7d2ef2d3d9ad3785e5e3e5e0bf17971d20676d..2c0aa1fbeeeed60163ab0b4c0b4d6fa010d4ed44 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2022-02-24 Youenn Fablet <youenn@apple.com> >+ >+ Non-simple CORS preflight fails due to cache-control header >+ https://bugs.webkit.org/show_bug.cgi?id=236837 >+ <rdar://problem/89382796> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ We fixed cache-control in https://bugs.webkit.org/show_bug.cgi?id=233916. >+ The fix to make the website work is to ensure that Content-Type is not cleared when going to service worker. >+ Covered by updated tests. >+ >+ * Modules/beacon/NavigatorBeacon.cpp: >+ > 2022-02-23 Youenn Fablet <youenn@apple.com> > > Allow to pass webrtc video frame buffers through RealtimeMediaSource based pipelines >diff --git a/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp b/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp >index de5c81f9a7a9d6696a21290c379e4c8ac956b931..eea828b4c9a5222a17d34de39bc75ded2d18ddca 100644 >--- a/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp >+++ b/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp >@@ -145,8 +145,10 @@ ExceptionOr<bool> NavigatorBeacon::sendBeacon(Document& document, const String& > request.setHTTPBody(fetchBody.bodyAsFormData()); > if (!mimeType.isEmpty()) { > request.setHTTPContentType(mimeType); >- if (!isCrossOriginSafeRequestHeader(HTTPHeaderName::ContentType, mimeType)) >+ if (!isCrossOriginSafeRequestHeader(HTTPHeaderName::ContentType, mimeType)) { > options.mode = FetchOptions::Mode::Cors; >+ options.httpHeadersToKeep.add(HTTPHeadersToKeepFromCleaning::ContentType); >+ } > } > } > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 5fc8f32a88c85b706fbcada9acc6d5f6e831b380..827761ba16334b3a6f8f10f5f2185dd3658fc9c5 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2022-02-24 Youenn Fablet <youenn@apple.com> >+ >+ Non-simple CORS preflight fails due to cache-control header >+ https://bugs.webkit.org/show_bug.cgi?id=236837 >+ <rdar://problem/89382796> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * http/wpt/service-workers/cache-control-request-expected.txt: >+ * http/wpt/service-workers/cache-control-request.html: >+ > 2022-02-23 Alejandro G. Castro <alex@igalia.com> > > Unreviewed test gardening. >diff --git a/LayoutTests/http/wpt/service-workers/cache-control-request-expected.txt b/LayoutTests/http/wpt/service-workers/cache-control-request-expected.txt >index 6fb80f773026ed46f48b235c64c65d351ef48f4a..e06c504bcfcb16791e931ea190c1154c4e3eeebb 100644 >--- a/LayoutTests/http/wpt/service-workers/cache-control-request-expected.txt >+++ b/LayoutTests/http/wpt/service-workers/cache-control-request-expected.txt >@@ -1,4 +1,5 @@ > > PASS Setup worker > PASS Ensure cache-control does not break service worker fetch handling >+PASS Ensure beacon headers are not broken by service worker fetch handling > >diff --git a/LayoutTests/http/wpt/service-workers/cache-control-request.html b/LayoutTests/http/wpt/service-workers/cache-control-request.html >index 73e4bfd1e9c33946cf63a7bdb89c73a5ae9b5869..a5ccafb8a6cde1c35e2f06dcc39864749dba4005 100644 >--- a/LayoutTests/http/wpt/service-workers/cache-control-request.html >+++ b/LayoutTests/http/wpt/service-workers/cache-control-request.html >@@ -5,6 +5,7 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script> > <script src="/common/get-host-info.sub.js"></script> >+<script src="/common/utils.js"></script> > </head> > <body> > <script> >@@ -33,6 +34,21 @@ promise_test(async (test) => { > assert_not_equals(await response.text(), "no cache-control header"); > iframe.remove(); > }, "Ensure cache-control does not break service worker fetch handling"); >+ >+promise_test(async (test) => { >+ const iframe = await with_iframe("resources/empty.html"); >+ >+ const id = token(); >+ const blob = new Blob(["test"], { type: "application/badabaoo" }); >+ >+ iframe.contentWindow.navigator.sendBeacon(get_host_info().HTTP_REMOTE_ORIGIN + "/WebKit/service-workers/resources/cross-origin-allow-for-beacon.py?token=" + id, blob); >+ await new Promise(resolve => setTimeout(resolve, 50)); >+ >+ const response = await fetch("/WebKit/service-workers/resources/cross-origin-allow-for-beacon.py?token=" + id); >+ assert_equals(await response.text(), "preflight ok"); >+ >+ iframe.remove(); >+}, "Ensure beacon headers are not broken by service worker fetch handling"); > </script> > </body> > </html>
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 236837
:
453082
|
453096