Bug 184433 - Refactor Ignore HSTS code
Summary: Refactor Ignore HSTS code
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: John Wilander
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-04-09 16:38 PDT by John Wilander
Modified: 2018-04-09 20:43 PDT (History)
4 users (show)

See Also:


Attachments
Patch (6.19 KB, patch)
2018-04-09 17:55 PDT, John Wilander
no flags Details | Formatted Diff | Diff
Patch for landing (6.06 KB, patch)
2018-04-09 20:06 PDT, John Wilander
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Wilander 2018-04-09 16:38:43 PDT
Darin Adler pointed out in https://bugs.webkit.org/show_bug.cgi?id=184335 that we might have subtle bugs in the ignore HSTS code due to type conversion. He also suggested moving non-SPI code out of the CFNetwork SPI header. This bug tracks that work.
Comment 1 Radar WebKit Bug Importer 2018-04-09 16:39:23 PDT
<rdar://problem/39298238>
Comment 2 John Wilander 2018-04-09 17:55:30 PDT
Created attachment 337565 [details]
Patch
Comment 3 Darin Adler 2018-04-09 18:40:49 PDT
Comment on attachment 337565 [details]
Patch

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

> Source/WebCore/platform/network/mac/WebCoreURLResponse.mm:337
> +    return [request respondsToSelector:@selector(_schemeWasUpgradedDueToDynamicHSTS)]
> +    && [request _schemeWasUpgradedDueToDynamicHSTS];

Should fix indentation of the second line, indent by 4 spaces.

> Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:189
> +    return [request respondsToSelector:@selector(_schemeWasUpgradedDueToDynamicHSTS)]
> +    && [request _schemeWasUpgradedDueToDynamicHSTS];

Should fix indentation of the second line, indent by 4 spaces.

> Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:197
> +    if ([request respondsToSelector:@selector(_setIgnoreHSTS:)]) {
> +        BOOL ignoreHSTSParameter = ignoreHSTS;
> +        [request _setIgnoreHSTS:ignoreHSTSParameter];
> +    }

This local BOOL is not needed here. It *was* needed for wtfObjcMsgSend, but here you can just pass the bool ignoreHSTS and it will be converted to a BOOL. Thus no braces needed either.

> Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:203
> +    return [request respondsToSelector:@selector(_ignoreHSTS)]
> +    && [request _ignoreHSTS];

Should fix indentation of the second line, indent by 4 spaces.
Comment 4 John Wilander 2018-04-09 20:06:35 PDT
Created attachment 337579 [details]
Patch for landing
Comment 5 John Wilander 2018-04-09 20:07:09 PDT
Thanks for the review and change suggestions, Darin!
Comment 6 WebKit Commit Bot 2018-04-09 20:43:51 PDT
Comment on attachment 337579 [details]
Patch for landing

Clearing flags on attachment: 337579

Committed r230467: <https://trac.webkit.org/changeset/230467>
Comment 7 WebKit Commit Bot 2018-04-09 20:43:53 PDT
All reviewed patches have been landed.  Closing bug.