[webkit-changes] [WebKit/WebKit] 2feb80: Refactor upgradeInsecureRequest logic, move to Res...

Commit Queue noreply at github.com
Fri Jul 19 18:12:20 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2feb80075a7dd69676d798f0c0363cf48ddd8d1f
      https://github.com/WebKit/WebKit/commit/2feb80075a7dd69676d798f0c0363cf48ddd8d1f
  Author: Matthew Finkel <m_finkel at apple.com>
  Date:   2024-07-19 (Fri, 19 Jul 2024)

  Changed paths:
    M Source/WebCore/contentextensions/ContentExtensionsBackend.cpp
    M Source/WebCore/loader/FrameLoader.cpp
    M Source/WebCore/page/csp/ContentSecurityPolicy.cpp
    M Source/WebCore/platform/network/ResourceRequestBase.cpp
    M Source/WebCore/platform/network/ResourceRequestBase.h

  Log Message:
  -----------
  Refactor upgradeInsecureRequest logic, move to ResourceRequest
https://bugs.webkit.org/show_bug.cgi?id=276806

Reviewed by Brent Fulgham.

upgradeInsecureRequest was implemented in ContentSecurityPolicy because that is
where it is specified by the standard. However, we're now using (re-using) that
logic in more places. This includes for upgraded mixed-content and when
preferring HTTPS for top-level navigations. For the cases of top-level
navigations, we may not have a Document or CSP policy at the time when we need
to make a decision, so consulting logic in ContentSecurityPolicy is confusing.

This patch moves the relevant logic into ResourceRequestBase which is a more
appropriate place for us to make decisions about modifying a request.

No behavioral changes, no new tests.

* Source/WebCore/contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::applyResultsToRequest):
* Source/WebCore/page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded const):
* Source/WebCore/platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::upgradeInsecureRequest):
(WebCore::ResourceRequestBase::upgradeInsecureRequestIfNeeded):
(WebCore::ResourceRequestBase::upgradeToHTTPS): Deleted.
* Source/WebCore/platform/network/ResourceRequestBase.h:

Canonical link: https://commits.webkit.org/281156@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list