URLParser should not try to interpret host of URLs with unrecognized schemes as IPv4...
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Oct 2016 00:17:01 +0000 (00:17 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Oct 2016 00:17:01 +0000 (00:17 +0000)
commit2aee23fe051b4f27bfd88bad6d74e5a88356d4bc
tree61ee712039fb134763960e843172cfb7a7ca94d8
parent99081f9c5bfa3f99ed14625ba79dd9eada348045
URLParser should not try to interpret host of URLs with unrecognized schemes as IPv4 address
https://bugs.webkit.org/show_bug.cgi?id=164154

Reviewed by Andy Estes.

Source/WebCore:

This is needed to match behavior of all browsers.
This is being discussed in the spec at https://github.com/whatwg/url/issues/148

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parseHostAndPort):
Only try to parse and canonicalize the host as an IPv4 address if the scheme is special (http, wss, etc.)

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208086 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/URLParser.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp