Bug 167795 - Allow some schemes to opt-out of CORS
Summary: Allow some schemes to opt-out of CORS
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-03 09:04 PST by youenn fablet
Modified: 2017-02-06 16:26 PST (History)
8 users (show)

See Also:


Attachments
Patch (20.55 KB, patch)
2017-02-03 10:58 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (10.40 KB, patch)
2017-02-06 08:43 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (10.34 KB, patch)
2017-02-06 15:49 PST, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2017-02-03 09:04:05 PST
Some schemes may be accessed through XHR/fetch but may not need CORS at all.
This is the case for data URLs and also for browser extension resources.
Comment 1 youenn fablet 2017-02-03 09:04:26 PST
Related to radar://30096129
Comment 2 youenn fablet 2017-02-03 10:58:00 PST
Created attachment 300551 [details]
Patch
Comment 3 youenn fablet 2017-02-06 08:43:03 PST
Created attachment 300724 [details]
Patch
Comment 4 Alex Christensen 2017-02-06 10:25:36 PST
Comment on attachment 300724 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=300724&action=review

> Source/WebCore/platform/SchemeRegistry.cpp:363
> +#if WTF_PLATFORM_MAC || WTF_PLATFORM_IOS

PLATFORM(COCOA)
Comment 5 Alex Christensen 2017-02-06 11:27:41 PST
Comment on attachment 300724 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=300724&action=review

> Source/WebCore/platform/SchemeRegistry.cpp:364
> +    if (scheme == "safari-extension")

If we need more schemes than just safari-extension, we should definitely make a PageSchemeRegistry.
Comment 6 Alex Christensen 2017-02-06 11:28:10 PST
Comment on attachment 300724 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=300724&action=review

>> Source/WebCore/platform/SchemeRegistry.cpp:363
>> +#if WTF_PLATFORM_MAC || WTF_PLATFORM_IOS
> 
> PLATFORM(COCOA)

Actually, this might only be needed on PLATFORM(MAC)
Comment 7 youenn fablet 2017-02-06 15:49:33 PST
Created attachment 300765 [details]
Patch for landing
Comment 8 Alex Christensen 2017-02-06 16:03:43 PST
Comment on attachment 300765 [details]
Patch for landing

View in context: https://bugs.webkit.org/attachment.cgi?id=300765&action=review

> Source/WebCore/platform/SchemeRegistry.cpp:364
> +    if (scheme == "safari-extension")

This is a layering violation.  WebCore shouldn't need to know about the safari-extension scheme.  The proper solution would be to make a PageSchemeRegistry and register this scheme for each WKWebView.  This is a good shortcut, though.
Comment 9 WebKit Commit Bot 2017-02-06 16:26:30 PST
Comment on attachment 300765 [details]
Patch for landing

Clearing flags on attachment: 300765

Committed r211758: <http://trac.webkit.org/changeset/211758>
Comment 10 WebKit Commit Bot 2017-02-06 16:26:36 PST
All reviewed patches have been landed.  Closing bug.