[Webkit-unassigned] [Bug 201180] New: Cannot send in-scheme CORS requests with WKURLSchemeHandler
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Aug 27 07:19:21 PDT 2019
https://bugs.webkit.org/show_bug.cgi?id=201180
Bug ID: 201180
Summary: Cannot send in-scheme CORS requests with
WKURLSchemeHandler
Product: WebKit
Version: Safari 12
Hardware: iPhone / iPad
OS: iOS 12
Status: NEW
Severity: Normal
Priority: P2
Component: WebKit API
Assignee: webkit-unassigned at lists.webkit.org
Reporter: webkitbugzilla at alastair.is
If I set up a WKURLSchemeHandler and have it load, e.g. test://host-one/index.html, and on that page I make a fetch() request to test://host-two/test.json the request fails before it is able to send, telling me:
> Cross origin requests are only supported for HTTP.
When I dug around the source code a little I found the following comment:
> Cross-origin requests are only allowed for HTTP and registered schemes. We would catch this when checking response headers later, but there is no reason to send a request that's guaranteed to be denied.
https://github.com/WebKit/webkit/blob/fc41ae69af5bce93e59ffdc1c828515199d12c44/Source/WebCore/loader/DocumentThreadableLoader.cpp#L175
A WKURLSchemeHandler is, I presume, a "registered scheme", so it seems as though the intention is for this to work? It would be great to get a confirm that either this is indeed a bug or whether it is intended behaviour, so that we can look for alternative solutions.
I've set up a very simple test XCode project here: https://github.com/alastaircoote/wkwebview-cors-test
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190827/266fac0d/attachment-0001.html>
More information about the webkit-unassigned
mailing list