Title: [228282] trunk
Revision
228282
Author
[email protected]
Date
2018-02-08 10:55:32 -0800 (Thu, 08 Feb 2018)

Log Message

Unreviewed, rolling out r228261.

This broke an internal build

Reverted changeset:

"Add a way to check if a host is an IP address"
https://bugs.webkit.org/show_bug.cgi?id=182427
https://trac.webkit.org/changeset/228261

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (228281 => 228282)


--- trunk/Source/WebCore/ChangeLog	2018-02-08 18:38:29 UTC (rev 228281)
+++ trunk/Source/WebCore/ChangeLog	2018-02-08 18:55:32 UTC (rev 228282)
@@ -1,3 +1,15 @@
+2018-02-08  Matt Lewis  <[email protected]>
+
+        Unreviewed, rolling out r228261.
+
+        This broke an internal build
+
+        Reverted changeset:
+
+        "Add a way to check if a host is an IP address"
+        https://bugs.webkit.org/show_bug.cgi?id=182427
+        https://trac.webkit.org/changeset/228261
+
 2018-02-08  Philippe Normand  <[email protected]>
 
         [GStreamer] WebKit improperly handles missing GStreamer elements

Modified: trunk/Source/WebCore/page/OriginAccessEntry.cpp (228281 => 228282)


--- trunk/Source/WebCore/page/OriginAccessEntry.cpp	2018-02-08 18:38:29 UTC (rev 228281)
+++ trunk/Source/WebCore/page/OriginAccessEntry.cpp	2018-02-08 18:55:32 UTC (rev 228282)
@@ -40,9 +40,11 @@
     , m_host(host.convertToASCIILowercase())
     , m_subdomainSettings(subdomainSetting)
     , m_ipAddressSettings(ipAddressSetting)
-    , m_hostIsIPAddress(URL::hostIsIPAddress(m_host))
 {
     ASSERT(subdomainSetting == AllowSubdomains || subdomainSetting == DisallowSubdomains);
+
+    // Assume that any host that ends with a digit is trying to be an IP address.
+    m_hostIsIPAddress = !m_host.isEmpty() && isASCIIDigit(m_host[m_host.length() - 1]);
 }
 
 bool OriginAccessEntry::matchesOrigin(const SecurityOrigin& origin) const
@@ -67,7 +69,7 @@
 
     // IP addresses are not domains: https://url.spec.whatwg.org/#concept-domain
     // Don't try to do subdomain matching on IP addresses.
-    if (m_ipAddressSettings == TreatIPAddressAsIPAddress && (m_hostIsIPAddress || URL::hostIsIPAddress(origin.host())))
+    if (m_hostIsIPAddress && m_ipAddressSettings == TreatIPAddressAsIPAddress)
         return false;
     
     // Match subdomains.

Modified: trunk/Source/WebCore/platform/URL.cpp (228281 => 228282)


--- trunk/Source/WebCore/platform/URL.cpp	2018-02-08 18:38:29 UTC (rev 228281)
+++ trunk/Source/WebCore/platform/URL.cpp	2018-02-08 18:55:32 UTC (rev 228282)
@@ -1035,12 +1035,4 @@
     return ts;
 }
 
-#if !PLATFORM(COCOA) && !USE(SOUP)
-bool URL::hostIsIPAddress(const String& host)
-{
-    // Assume that any host that ends with a digit is trying to be an IP address.
-    return !host.isEmpty() && isASCIIDigit(host[host.length() - 1]);
-}
-#endif
-
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/URL.h (228281 => 228282)


--- trunk/Source/WebCore/platform/URL.h	2018-02-08 18:38:29 UTC (rev 228281)
+++ trunk/Source/WebCore/platform/URL.h	2018-02-08 18:55:32 UTC (rev 228282)
@@ -175,8 +175,6 @@
     unsigned hostStart() const;
     unsigned hostEnd() const;
 
-    WEBCORE_EXPORT static bool hostIsIPAddress(const String&);
-
     unsigned pathStart() const;
     unsigned pathEnd() const;
     unsigned pathAfterLastSlash() const;

Modified: trunk/Source/WebCore/platform/mac/PublicSuffixMac.mm (228281 => 228282)


--- trunk/Source/WebCore/platform/mac/PublicSuffixMac.mm	2018-02-08 18:38:29 UTC (rev 228281)
+++ trunk/Source/WebCore/platform/mac/PublicSuffixMac.mm	2018-02-08 18:55:32 UTC (rev 228282)
@@ -28,9 +28,13 @@
 
 #if ENABLE(PUBLIC_SUFFIX_LIST)
 
-#import "URL.h"
+#import "WebCoreNSURLExtras.h"
 #import <pal/spi/cf/CFNetworkSPI.h>
 
+@interface NSString (WebCoreNSURLExtras)
+- (BOOL)_web_looksLikeIPAddress;
+@end
+
 namespace WebCore {
 
 bool isPublicSuffix(const String& domain)
@@ -41,7 +45,7 @@
 
 String topPrivatelyControlledDomain(const String& domain)
 {
-    if (URL::hostIsIPAddress(domain))
+    if ([domain _web_looksLikeIPAddress])
         return domain;
 
     if (!domain.isAllASCII())

Modified: trunk/Source/WebCore/platform/mac/URLMac.mm (228281 => 228282)


--- trunk/Source/WebCore/platform/mac/URLMac.mm	2018-02-08 18:38:29 UTC (rev 228281)
+++ trunk/Source/WebCore/platform/mac/URLMac.mm	2018-02-08 18:55:32 UTC (rev 228282)
@@ -28,14 +28,9 @@
 
 #import "CFURLExtras.h"
 #import "URLParser.h"
-#import "WebCoreNSURLExtras.h"
 #import <wtf/ObjcRuntimeExtras.h>
 #import <wtf/text/CString.h>
 
-@interface NSString (WebCoreNSURLExtras)
-- (BOOL)_web_looksLikeIPAddress;
-@end
-
 namespace WebCore {
 
 URL::URL(NSURL *url)
@@ -79,9 +74,4 @@
     return createCFURLFromBuffer(buffer.data(), buffer.size());
 }
 
-bool URL::hostIsIPAddress(const String& host)
-{
-    return [host _web_looksLikeIPAddress];
 }
-
-}

Modified: trunk/Source/WebCore/platform/network/curl/CookieUtil.cpp (228281 => 228282)


--- trunk/Source/WebCore/platform/network/curl/CookieUtil.cpp	2018-02-08 18:38:29 UTC (rev 228281)
+++ trunk/Source/WebCore/platform/network/curl/CookieUtil.cpp	2018-02-08 18:55:32 UTC (rev 228282)
@@ -53,7 +53,8 @@
 
 bool isIPAddress(const String& hostname)
 {
-    return URL::hostIsIPAddress(hostname);
+    // Assuming that hosts ending in a digit are IP Addresses
+    return !hostname.isEmpty() && isASCIIDigit(hostname[hostname.length() - 1]);
 }
 
 bool domainMatch(const String& cookieDomain, const String& host)

Modified: trunk/Source/WebCore/platform/soup/URLSoup.cpp (228281 => 228282)


--- trunk/Source/WebCore/platform/soup/URLSoup.cpp	2018-02-08 18:38:29 UTC (rev 228281)
+++ trunk/Source/WebCore/platform/soup/URLSoup.cpp	2018-02-08 18:55:32 UTC (rev 228282)
@@ -66,11 +66,6 @@
     return GUniquePtr<SoupURI>(soup_uri_new(string().utf8().data()));
 }
 
-bool URL::hostIsIPAddress(const String& host)
-{
-    return !host.isEmpty() && g_hostname_is_ip_address(host.utf8().data());
-}
-
 } // namespace WebCore
 
 #endif

Modified: trunk/Tools/ChangeLog (228281 => 228282)


--- trunk/Tools/ChangeLog	2018-02-08 18:38:29 UTC (rev 228281)
+++ trunk/Tools/ChangeLog	2018-02-08 18:55:32 UTC (rev 228282)
@@ -1,3 +1,15 @@
+2018-02-08  Matt Lewis  <[email protected]>
+
+        Unreviewed, rolling out r228261.
+
+        This broke an internal build
+
+        Reverted changeset:
+
+        "Add a way to check if a host is an IP address"
+        https://bugs.webkit.org/show_bug.cgi?id=182427
+        https://trac.webkit.org/changeset/228261
+
 2018-02-08  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r228267, r228268, and r228269.

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/URL.cpp (228281 => 228282)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/URL.cpp	2018-02-08 18:38:29 UTC (rev 228281)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/URL.cpp	2018-02-08 18:55:32 UTC (rev 228282)
@@ -231,37 +231,4 @@
     EXPECT_TRUE(protocolIsInHTTPFamily("https://!@#$%^&*()"));
 }
 
-TEST_F(URLTest, HostIsIPAddress)
-{
-    EXPECT_FALSE(URL::hostIsIPAddress({ }));
-    EXPECT_FALSE(URL::hostIsIPAddress(""));
-    EXPECT_FALSE(URL::hostIsIPAddress("localhost"));
-    EXPECT_FALSE(URL::hostIsIPAddress("127.localhost"));
-    EXPECT_FALSE(URL::hostIsIPAddress("localhost.127"));
-    EXPECT_FALSE(URL::hostIsIPAddress("127.0.0"));
-    EXPECT_FALSE(URL::hostIsIPAddress("127.0 .0.1"));
-    EXPECT_FALSE(URL::hostIsIPAddress(" 127.0.0.1"));
-    EXPECT_FALSE(URL::hostIsIPAddress("127..0.0.1"));
-    EXPECT_FALSE(URL::hostIsIPAddress("127.0.0."));
-    EXPECT_FALSE(URL::hostIsIPAddress("0123:4567:89AB:cdef:3210:7654:ba98"));
-    EXPECT_FALSE(URL::hostIsIPAddress("012x:4567:89AB:cdef:3210:7654:ba98:FeDc"));
-#if !PLATFORM(COCOA)
-    // FIXME: This fails in Mac.
-    EXPECT_FALSE(URL::hostIsIPAddress("00123:4567:89AB:cdef:3210:7654:ba98:FeDc"));
-#endif
-    EXPECT_FALSE(URL::hostIsIPAddress("0123:4567:89AB:cdef:3210:123.45.67.89"));
-    EXPECT_FALSE(URL::hostIsIPAddress(":::"));
-
-    EXPECT_TRUE(URL::hostIsIPAddress("127.0.0.1"));
-    EXPECT_TRUE(URL::hostIsIPAddress("123.45.67.89"));
-    EXPECT_TRUE(URL::hostIsIPAddress("0.0.0.0"));
-    EXPECT_TRUE(URL::hostIsIPAddress("::1"));
-    EXPECT_TRUE(URL::hostIsIPAddress("::"));
-    EXPECT_TRUE(URL::hostIsIPAddress("0123:4567:89AB:cdef:3210:7654:ba98:FeDc"));
-    EXPECT_TRUE(URL::hostIsIPAddress("0123:4567:89AB:cdef:3210:7654:ba98::"));
-    EXPECT_TRUE(URL::hostIsIPAddress("::4567:89AB:cdef:3210:7654:ba98:FeDc"));
-    EXPECT_TRUE(URL::hostIsIPAddress("0123:4567:89AB:cdef:3210:7654:123.45.67.89"));
-    EXPECT_TRUE(URL::hostIsIPAddress("::123.45.67.89"));
-}
-
 } // namespace TestWebKitAPI
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to