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

Changeset 238666 in webkit


Ignore:
Timestamp:
Nov 29, 2018, 4:34:26 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Remove some superfluous code in ContentSecurityPolicy::upgradeInsecureRequestIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=192076

Patch by Rob Buis <rbuis@igalia.com> on 2018-11-29
Reviewed by Frédéric Wang.

Since we do an early return if the protocol is not http or ws, the if check
for ws protocol and else statement are not needed, so use an ASSERT instead.

  • page/csp/ContentSecurityPolicy.cpp:

(WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded const):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r238665 r238666  
     12018-11-29  Rob Buis  <rbuis@igalia.com>
     2
     3        Remove some superfluous code in ContentSecurityPolicy::upgradeInsecureRequestIfNeeded
     4        https://bugs.webkit.org/show_bug.cgi?id=192076
     5
     6        Reviewed by Frédéric Wang.
     7
     8        Since we do an early return if the protocol is not http or ws, the if check
     9        for ws protocol and else statement are not needed, so use an ASSERT instead.
     10
     11        * page/csp/ContentSecurityPolicy.cpp:
     12        (WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded const):
     13
    1142018-11-29  Frederic Wang  <fwang@igalia.com>
    215
  • trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp

    r234586 r238666  
    883883    if (requestType == InsecureRequestType::Load || requestType == InsecureRequestType::FormSubmission)
    884884        upgradeRequest |= m_upgradeInsecureRequests;
    885    
     885
    886886    if (!upgradeRequest)
    887887        return;
     
    889889    if (url.protocolIs("http"))
    890890        url.setProtocol("https");
    891     else if (url.protocolIs("ws"))
     891    else {
     892        ASSERT(url.protocolIs("ws"));
    892893        url.setProtocol("wss");
    893     else
    894         return;
    895    
     894    }
     895
    896896    if (url.port() && url.port().value() == 80)
    897897        url.setPort(443);
Note: See TracChangeset for help on using the changeset viewer.