Ignore:
Timestamp:
Apr 27, 2022, 3:36:07 AM (3 years ago)
Author:
[email protected]
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):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.