Changeset 293503 in webkit


Ignore:
Timestamp:
Apr 27, 2022 3:36:07 AM (3 months ago)
Author:
youenn@apple.com
Message:

<link rel=preconnect> always sends credentials to different-origin, ignoring crossorigin=anonymous
https://bugs.webkit.org/show_bug.cgi?id=239119
<rdar://problem/91643534>

Reviewed by John Wilander.

Update the check as per spec, step 5 of
https://html.spec.whatwg.org/multipage/links.html#link-type-preconnect

This is difficult to test as preconnect can only expose TLS credentials.

  • loader/LinkLoader.cpp:

(WebCore::LinkLoader::preconnectIfNeeded):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r293502 r293503  
     12022-04-27  Youenn Fablet  <youenn@apple.com>
     2
     3        <link rel=preconnect> always sends credentials to different-origin, ignoring crossorigin=anonymous
     4        https://bugs.webkit.org/show_bug.cgi?id=239119
     5        <rdar://problem/91643534>
     6
     7        Reviewed by John Wilander.
     8
     9        Update the check as per spec, step 5 of
     10        https://html.spec.whatwg.org/multipage/links.html#link-type-preconnect
     11
     12        This is difficult to test as preconnect can only expose TLS credentials.
     13
     14        * loader/LinkLoader.cpp:
     15        (WebCore::LinkLoader::preconnectIfNeeded):
     16
    1172022-04-27  Youenn Fablet  <youenn@apple.com>
    218
  • trunk/Source/WebCore/loader/LinkLoader.cpp

    r293484 r293503  
    215215    ASSERT(document.settings().linkPreconnectEnabled());
    216216    StoredCredentialsPolicy storageCredentialsPolicy = StoredCredentialsPolicy::Use;
    217     if (equalLettersIgnoringASCIICase(params.crossOrigin, "anonymous"_s) && document.securityOrigin().isSameOriginDomain(SecurityOrigin::create(href)))
     217    if (equalLettersIgnoringASCIICase(params.crossOrigin, "anonymous"_s) && !document.securityOrigin().isSameOriginDomain(SecurityOrigin::create(href)))
    218218        storageCredentialsPolicy = StoredCredentialsPolicy::DoNotUse;
    219219    ASSERT(document.frame()->loader().networkingContext());
Note: See TracChangeset for help on using the changeset viewer.