Title: [238666] trunk/Source/WebCore
- Revision
- 238666
- Author
- [email protected]
- Date
- 2018-11-29 04:34:26 -0800 (Thu, 29 Nov 2018)
Log Message
Remove some superfluous code in ContentSecurityPolicy::upgradeInsecureRequestIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=192076
Patch by Rob Buis <[email protected]> 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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (238665 => 238666)
--- trunk/Source/WebCore/ChangeLog 2018-11-29 11:44:50 UTC (rev 238665)
+++ trunk/Source/WebCore/ChangeLog 2018-11-29 12:34:26 UTC (rev 238666)
@@ -1,3 +1,16 @@
+2018-11-29 Rob Buis <[email protected]>
+
+ Remove some superfluous code in ContentSecurityPolicy::upgradeInsecureRequestIfNeeded
+ https://bugs.webkit.org/show_bug.cgi?id=192076
+
+ 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):
+
2018-11-29 Frederic Wang <[email protected]>
Add ParentRelativeScrollableRect to ScrollingCoordinator::ScrollingGeometry
Modified: trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp (238665 => 238666)
--- trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp 2018-11-29 11:44:50 UTC (rev 238665)
+++ trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp 2018-11-29 12:34:26 UTC (rev 238666)
@@ -882,17 +882,17 @@
bool upgradeRequest = m_insecureNavigationRequestsToUpgrade.contains(SecurityOriginData::fromURL(url));
if (requestType == InsecureRequestType::Load || requestType == InsecureRequestType::FormSubmission)
upgradeRequest |= m_upgradeInsecureRequests;
-
+
if (!upgradeRequest)
return;
if (url.protocolIs("http"))
url.setProtocol("https");
- else if (url.protocolIs("ws"))
+ else {
+ ASSERT(url.protocolIs("ws"));
url.setProtocol("wss");
- else
- return;
-
+ }
+
if (url.port() && url.port().value() == 80)
url.setPort(443);
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes