Changeset 228118 in webkit
- Timestamp:
- Feb 5, 2018 1:36:18 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r228117 r228118 1 2018-02-05 Matt Lewis <jlewis3@apple.com> 2 3 Unreviewed, rolling out r228086. 4 5 This introduced a failure with API test 6 URLTest.HostIsIPAddress. 7 8 Reverted changeset: 9 10 "Add a way to check if a host is an IP address" 11 https://bugs.webkit.org/show_bug.cgi?id=182427 12 https://trac.webkit.org/changeset/228086 13 1 14 2018-02-05 Matt Lewis <jlewis3@apple.com> 2 15 -
trunk/Source/WebCore/page/OriginAccessEntry.cpp
r228086 r228118 41 41 , m_subdomainSettings(subdomainSetting) 42 42 , m_ipAddressSettings(ipAddressSetting) 43 , m_hostIsIPAddress(URL::hostIsIPAddress(m_host))44 43 { 45 44 ASSERT(subdomainSetting == AllowSubdomains || subdomainSetting == DisallowSubdomains); 45 46 // Assume that any host that ends with a digit is trying to be an IP address. 47 m_hostIsIPAddress = !m_host.isEmpty() && isASCIIDigit(m_host[m_host.length() - 1]); 46 48 } 47 49 … … 68 70 // IP addresses are not domains: https://url.spec.whatwg.org/#concept-domain 69 71 // Don't try to do subdomain matching on IP addresses. 70 if (m_ ipAddressSettings == TreatIPAddressAsIPAddress && (m_hostIsIPAddress || URL::hostIsIPAddress(origin.host())))72 if (m_hostIsIPAddress && m_ipAddressSettings == TreatIPAddressAsIPAddress) 71 73 return false; 72 74 -
trunk/Source/WebCore/platform/URL.cpp
r228086 r228118 1036 1036 } 1037 1037 1038 #if !PLATFORM(COCOA) && !USE(SOUP)1039 bool URL::hostIsIPAddress(const String& host)1040 {1041 // Assume that any host that ends with a digit is trying to be an IP address.1042 return !host.isEmpty() && isASCIIDigit(host[host.length() - 1]);1043 }1044 #endif1045 1046 1038 } // namespace WebCore -
trunk/Source/WebCore/platform/URL.h
r228086 r228118 176 176 unsigned hostEnd() const; 177 177 178 WEBCORE_EXPORT static bool hostIsIPAddress(const String&);179 180 178 unsigned pathStart() const; 181 179 unsigned pathEnd() const; -
trunk/Source/WebCore/platform/mac/PublicSuffixMac.mm
r228086 r228118 29 29 #if ENABLE(PUBLIC_SUFFIX_LIST) 30 30 31 #import " URL.h"31 #import "WebCoreNSURLExtras.h" 32 32 #import <pal/spi/cf/CFNetworkSPI.h> 33 34 @interface NSString (WebCoreNSURLExtras) 35 - (BOOL)_web_looksLikeIPAddress; 36 @end 33 37 34 38 namespace WebCore { … … 42 46 String topPrivatelyControlledDomain(const String& domain) 43 47 { 44 if ( URL::hostIsIPAddress(domain))48 if ([domain _web_looksLikeIPAddress]) 45 49 return domain; 46 50 -
trunk/Source/WebCore/platform/mac/URLMac.mm
r228086 r228118 29 29 #import "CFURLExtras.h" 30 30 #import "URLParser.h" 31 #import "WebCoreNSURLExtras.h"32 31 #import <wtf/ObjcRuntimeExtras.h> 33 32 #import <wtf/text/CString.h> 34 35 @interface NSString (WebCoreNSURLExtras)36 - (BOOL)_web_looksLikeIPAddress;37 @end38 33 39 34 namespace WebCore { … … 80 75 } 81 76 82 bool URL::hostIsIPAddress(const String& host)83 {84 return [host _web_looksLikeIPAddress];85 77 } 86 87 } -
trunk/Source/WebCore/platform/network/curl/CookieUtil.cpp
r228086 r228118 54 54 bool isIPAddress(const String& hostname) 55 55 { 56 return URL::hostIsIPAddress(hostname); 56 // Assuming that hosts ending in a digit are IP Addresses 57 return !hostname.isEmpty() && isASCIIDigit(hostname[hostname.length() - 1]); 57 58 } 58 59 -
trunk/Source/WebCore/platform/soup/URLSoup.cpp
r228086 r228118 67 67 } 68 68 69 bool URL::hostIsIPAddress(const String& host)70 {71 return !host.isEmpty() && g_hostname_is_ip_address(host.utf8().data());72 }73 74 69 } // namespace WebCore 75 70 -
trunk/Tools/ChangeLog
r228109 r228118 1 2018-02-05 Matt Lewis <jlewis3@apple.com> 2 3 Unreviewed, rolling out r228086. 4 5 This introduced a failure with API test 6 URLTest.HostIsIPAddress. 7 8 Reverted changeset: 9 10 "Add a way to check if a host is an IP address" 11 https://bugs.webkit.org/show_bug.cgi?id=182427 12 https://trac.webkit.org/changeset/228086 13 1 14 2018-02-05 John Wilander <wilander@apple.com> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WebCore/URL.cpp
r228086 r228118 232 232 } 233 233 234 TEST_F(URLTest, HostIsIPAddress)235 {236 EXPECT_FALSE(URL::hostIsIPAddress({ }));237 EXPECT_FALSE(URL::hostIsIPAddress(""));238 EXPECT_FALSE(URL::hostIsIPAddress("localhost"));239 EXPECT_FALSE(URL::hostIsIPAddress("127.localhost"));240 EXPECT_FALSE(URL::hostIsIPAddress("localhost.127"));241 EXPECT_FALSE(URL::hostIsIPAddress("127.0.0"));242 EXPECT_FALSE(URL::hostIsIPAddress("127.0 .0.1"));243 EXPECT_FALSE(URL::hostIsIPAddress(" 127.0.0.1"));244 EXPECT_FALSE(URL::hostIsIPAddress("127..0.0.1"));245 EXPECT_FALSE(URL::hostIsIPAddress("127.0.0."));246 EXPECT_FALSE(URL::hostIsIPAddress("0123:4567:89AB:cdef:3210:7654:ba98"));247 EXPECT_FALSE(URL::hostIsIPAddress("012x:4567:89AB:cdef:3210:7654:ba98:FeDc"));248 EXPECT_FALSE(URL::hostIsIPAddress("00123:4567:89AB:cdef:3210:7654:ba98:FeDc"));249 EXPECT_FALSE(URL::hostIsIPAddress("0123:4567:89AB:cdef:3210:123.45.67.89"));250 EXPECT_FALSE(URL::hostIsIPAddress(":::"));251 252 EXPECT_TRUE(URL::hostIsIPAddress("127.0.0.1"));253 EXPECT_TRUE(URL::hostIsIPAddress("123.45.67.89"));254 EXPECT_TRUE(URL::hostIsIPAddress("0.0.0.0"));255 EXPECT_TRUE(URL::hostIsIPAddress("::1"));256 EXPECT_TRUE(URL::hostIsIPAddress("::"));257 EXPECT_TRUE(URL::hostIsIPAddress("0123:4567:89AB:cdef:3210:7654:ba98:FeDc"));258 EXPECT_TRUE(URL::hostIsIPAddress("0123:4567:89AB:cdef:3210:7654:ba98::"));259 EXPECT_TRUE(URL::hostIsIPAddress("::4567:89AB:cdef:3210:7654:ba98:FeDc"));260 EXPECT_TRUE(URL::hostIsIPAddress("0123:4567:89AB:cdef:3210:7654:123.45.67.89"));261 EXPECT_TRUE(URL::hostIsIPAddress("::123.45.67.89"));262 }263 264 234 } // namespace TestWebKitAPI
Note: See TracChangeset
for help on using the changeset viewer.