[Webkit-unassigned] [Bug 192094] HTTPS Upgrade: Consult dummy storage for HTTPS Upgrade, Apply If Appropriate

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 28 14:36:24 PST 2018


https://bugs.webkit.org/show_bug.cgi?id=192094

--- Comment #4 from Chris Dumez <cdumez at apple.com> ---
Comment on attachment 355916
  --> https://bugs.webkit.org/attachment.cgi?id=355916
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=355916&action=review

> Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp:44
> +#include <wtf/Vector.h>

Not needed.

> Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp:207
> +    if (url.protocolIs("http"_s)) {

In webKit, we prefer early returns whenever possible. So this would be:
if (!url.protocolIs("http"))
    return false;

if (!upgradableHosts.get().contains(url.host().toString()))
    return false;

auto newURL = url;
newURL.setProtocol("https"_s);
request.setURL(newURL);
return true;

Note that I used url.protocolIs("http") instead of url.protocolIs("http"_s) as well. protocolIs() takes in a const char*, not a String.

> Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp:226
> +            ASSERT(request.url().protocolIs("https"_s));

no _s.

> Source/WebKit/NetworkProcess/NetworkLoadChecker.h:143
> +    bool applyHTTPSUpgradeIfNeeded(WebCore::ResourceRequest&);

can this be static? It does not look like it uses any members.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20181128/fff4ac8f/attachment.html>


More information about the webkit-unassigned mailing list