Bug 205534 - Add SPI to disable CORS on requests to URLs matching a pattern
Summary: Add SPI to disable CORS on requests to URLs matching a pattern
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-12-20 17:57 PST by Alex Christensen
Modified: 2020-01-02 13:14 PST (History)
5 users (show)

See Also:


Attachments
Patch (17.57 KB, patch)
2019-12-20 18:21 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (17.55 KB, patch)
2019-12-21 00:31 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (17.62 KB, patch)
2019-12-21 07:56 PST, Alex Christensen
cdumez: review+
cdumez: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2019-12-20 17:57:47 PST
Add SPI to disable CORS on requests to URLs matching a pattern
Comment 1 Alex Christensen 2019-12-20 18:21:00 PST
Created attachment 386285 [details]
Patch
Comment 2 Alex Christensen 2019-12-20 18:21:04 PST
<rdar://problem/58011337>
Comment 3 Alex Christensen 2019-12-21 00:31:17 PST
Created attachment 386293 [details]
Patch
Comment 4 Alex Christensen 2019-12-21 07:56:11 PST
Created attachment 386296 [details]
Patch
Comment 5 Chris Dumez 2020-01-02 11:57:30 PST
Comment on attachment 386296 [details]
Patch

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

r=me

> Source/WebCore/loader/DocumentThreadableLoader.cpp:156
> +    bool disableCORS = document.isRunningUserScripts() && LegacySchemeRegistry::isUserExtensionScheme(request.url().protocol().toStringWithoutCopying());

s/disableCORS/shouldDisableCORS

> Source/WebCore/page/Page.cpp:338
> +    }

Shouldn't we shrinkToFit() afterwards?

> Source/WebCore/page/Page.cpp:3102
> +    for (const auto& pattern : m_corsDisablingPatterns) {

Could be written using WTF::anyOf()

> Source/WebKit/UIProcess/API/APIPageConfiguration.h:138
> +    const Vector<WTF::String> corsDisablingPatterns() const { return m_corsDisablingPatterns; }

const Vector<WTF::String>& for return value.
Comment 6 Alex Christensen 2020-01-02 13:14:15 PST
http://trac.webkit.org/r253978