⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 279490 in webkit


Ignore:
Timestamp:
Jul 1, 2021, 6:03:53 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Align beacon CORS mode with Chrome and Firefox
​https://bugs.webkit.org/show_bug.cgi?id=227590

Patch by Alex Christensen <​achristensen@webkit.org> on 2021-07-01
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

  • web-platform-tests/beacon/beacon-cors.https.window-expected.txt:

Source/WebCore:

This follows ​https://w3c.github.io/beacon/#sec-processing-model step 6.3.
Now we pass a WPT test that Chrome and Firefox already passed.

  • Modules/beacon/NavigatorBeacon.cpp:

(WebCore::NavigatorBeacon::sendBeacon):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r279472 r279490  
     12021-07-01  Alex Christensen  <achristensen@webkit.org>
     2
     3        Align beacon CORS mode with Chrome and Firefox
     4        https://bugs.webkit.org/show_bug.cgi?id=227590
     5
     6        Reviewed by Chris Dumez.
     7
     8        * web-platform-tests/beacon/beacon-cors.https.window-expected.txt:
     9
    1102021-07-01  Youenn Fablet  <youenn@apple.com>
    211
  • trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/beacon-cors.https.window-expected.txt

    r279224 r279490  
    22PASS /common/redirect.py does not support CORS
    33PASS cross-origin, CORS-safelisted: type = string
    4 FAIL cross-origin, CORS-safelisted: type = arraybuffer assert_true: timeout expected true got false
     4PASS cross-origin, CORS-safelisted: type = arraybuffer
    55PASS cross-origin, CORS-safelisted: type = form
    6 FAIL cross-origin, CORS-safelisted: type = blob assert_true: timeout expected true got false
     6PASS cross-origin, CORS-safelisted: type = blob
    77PASS cross-origin, non-CORS-safelisted: failure case (with redirect)
    88PASS cross-origin, non-CORS-safelisted: failure case (without redirect)
  • trunk/Source/WebCore/ChangeLog

    r279489 r279490  
     12021-07-01  Alex Christensen  <achristensen@webkit.org>
     2
     3        Align beacon CORS mode with Chrome and Firefox
     4        https://bugs.webkit.org/show_bug.cgi?id=227590
     5
     6        Reviewed by Chris Dumez.
     7
     8        This follows https://w3c.github.io/beacon/#sec-processing-model step 6.3.
     9        Now we pass a WPT test that Chrome and Firefox already passed.
     10
     11        * Modules/beacon/NavigatorBeacon.cpp:
     12        (WebCore::NavigatorBeacon::sendBeacon):
     13
    1142021-07-01  Amir Mark Jr  <amir_mark@apple.com>
    215
  • trunk/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp

    r278253 r279490  
    131131
    132132    if (body) {
    133         options.mode = FetchOptions::Mode::Cors;
     133        options.mode = FetchOptions::Mode::NoCors;
    134134        String mimeType;
    135135        auto result = FetchBody::extract(WTFMove(body.value()), mimeType);
    … …  
    143143        if (!mimeType.isEmpty()) {
    144144            request.setHTTPContentType(mimeType);
    145             if (isCrossOriginSafeRequestHeader(HTTPHeaderName::ContentType, mimeType))
    146                 options.mode = FetchOptions::Mode::NoCors;
     145            if (!isCrossOriginSafeRequestHeader(HTTPHeaderName::ContentType, mimeType))
     146                options.mode = FetchOptions::Mode::Cors;
    147147        }
    148148    }
Note: See TracChangeset for help on using the changeset viewer.