Commit 55323c28 authored by eric@webkit.org's avatar eric@webkit.org

2011-02-09 Eric Seidel <eric@webkit.org>

        Reviewed by Adam Barth.

        Hostnames should cannonicalize to lowercase (to match every other browser)
        https://bugs.webkit.org/show_bug.cgi?id=54084

        Pretty obvious change.  KURL is the odd man out here.

        * fast/url/host-expected.txt:
        * fast/url/ipv4-expected.txt:
        * fast/url/ipv6-expected.txt:
        * fast/url/relative-expected.txt:
        * fast/url/relative-unix-expected.txt:
        * fast/url/standard-url-expected.txt:
2011-02-09  Eric Seidel  <eric@webkit.org>

        Reviewed by Adam Barth.

        Hostnames should cannonicalize to lowercase (to match every other browser)
        https://bugs.webkit.org/show_bug.cgi?id=54084

        * platform/KURL.cpp:
        (WebCore::KURL::parse):

git-svn-id: svn://svn.chromium.org/blink/trunk@78044 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e5249244
2011-02-09 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
Hostnames should cannonicalize to lowercase (to match every other browser)
https://bugs.webkit.org/show_bug.cgi?id=54084
Pretty obvious change. KURL is the odd man out here.
* fast/url/host-expected.txt:
* fast/url/ipv4-expected.txt:
* fast/url/ipv6-expected.txt:
* fast/url/relative-expected.txt:
* fast/url/relative-unix-expected.txt:
* fast/url/standard-url-expected.txt:
2011-02-09 Sergio Villar Senin <svillar@igalia.com>
Unreviewed.
......@@ -3,7 +3,7 @@ Canonicalization of host names.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
FAIL canonicalize('http://GoOgLe.CoM/') should be http://google.com/. Was http://GoOgLe.CoM/.
PASS canonicalize('http://GoOgLe.CoM/') is 'http://google.com/'
FAIL canonicalize('http://Goo%20 goo%7C|.com/') should be http://goo%20%20goo%7C%7C.com/. Was http://Goo%20 goo%7C|.com/.
FAIL canonicalize('http://GOO  goo.com/') should be http://goo%20%20goo.com/. Was http://goo goo.com/.
PASS canonicalize('http://GOO​⁠goo.com/') is 'http://googoo.com/'
......@@ -22,7 +22,7 @@ PASS canonicalize('http://%25/') is 'http://%25/'
PASS canonicalize('http://hello%00/') is 'http://hello%00/'
FAIL canonicalize('http://%30%78%63%30%2e%30%32%35%30.01/') should be http://192.168.0.1/. Was http://%30%78%63%30%2e%30%32%35%30.01/.
FAIL canonicalize('http://%30%78%63%30%2e%30%32%35%30.01%2e/') should be http://192.168.0.1/. Was http://%30%78%63%30%2e%30%32%35%30.01%2e/.
FAIL canonicalize('http://%3g%78%63%30%2e%30%32%35%30%2E.01/') should be http://%253gxc0.0250..01/. Was http://%3g%78%63%30%2e%30%32%35%30%2E.01/.
FAIL canonicalize('http://%3g%78%63%30%2e%30%32%35%30%2E.01/') should be http://%253gxc0.0250..01/. Was http://%3g%78%63%30%2e%30%32%35%30%2e.01/.
FAIL canonicalize('http://192.168.0.1 hello/') should be http://192.168.0.1%20hello/. Was http://192.168.0.1 hello/.
FAIL canonicalize('http://0Xc0.0250.01/') should be http://192.168.0.1/. Was http://0xc0.0250.01/.
PASS canonicalize('http://192.168.0.257/') is 'http://192.168.0.257/'
......
......@@ -7,17 +7,17 @@ FAIL canonicalize('http:///') should be http:. Was http:/.
PASS canonicalize('http://./') is 'http://./'
PASS canonicalize('http://192.168.0.1/') is 'http://192.168.0.1/'
FAIL canonicalize('http://0300.0250.00.01/') should be http://192.168.0.1/. Was http://0300.0250.00.01/.
FAIL canonicalize('http://0xC0.0Xa8.0x0.0x1/') should be http://192.168.0.1/. Was http://0xC0.0Xa8.0x0.0x1/.
FAIL canonicalize('http://0xC0.0Xa8.0x0.0x1/') should be http://192.168.0.1/. Was http://0xc0.0xa8.0x0.0x1/.
PASS canonicalize('http://192.168.9.com/') is 'http://192.168.9.com/'
PASS canonicalize('http://19a.168.0.1/') is 'http://19a.168.0.1/'
PASS canonicalize('http://0308.0250.00.01/') is 'http://0308.0250.00.01/'
FAIL canonicalize('http://0xCG.0xA8.0x0.0x1/') should be http://0xcg.0xa8.0x0.0x1/. Was http://0xCG.0xA8.0x0.0x1/.
PASS canonicalize('http://0xCG.0xA8.0x0.0x1/') is 'http://0xcg.0xa8.0x0.0x1/'
FAIL canonicalize('http://192/') should be http://0.0.0.192/. Was http://192/.
FAIL canonicalize('http://0xC0a80001/') should be http://192.168.0.1/. Was http://0xC0a80001/.
FAIL canonicalize('http://0xC0a80001/') should be http://192.168.0.1/. Was http://0xc0a80001/.
FAIL canonicalize('http://030052000001/') should be http://192.168.0.1/. Was http://030052000001/.
FAIL canonicalize('http://000030052000001/') should be http://192.168.0.1/. Was http://000030052000001/.
FAIL canonicalize('http://192.168/') should be http://192.0.0.168/. Was http://192.168/.
FAIL canonicalize('http://192.0x00A80001/') should be http://192.168.0.1/. Was http://192.0x00A80001/.
FAIL canonicalize('http://192.0x00A80001/') should be http://192.168.0.1/. Was http://192.0x00a80001/.
FAIL canonicalize('http://0xc0.052000001/') should be http://192.168.0.1/. Was http://0xc0.052000001/.
FAIL canonicalize('http://192.168.1/') should be http://192.168.0.1/. Was http://192.168.1/.
PASS canonicalize('http://192.168.0.0.1/') is 'http://192.168.0.0.1/'
......@@ -34,24 +34,24 @@ PASS canonicalize('http://0.0.0.0x100/') is 'http://0.0.0.0x100/'
PASS canonicalize('http://0.0.0x10000/') is 'http://0.0.0x10000/'
PASS canonicalize('http://0.0x1000000/') is 'http://0.0x1000000/'
PASS canonicalize('http://0x100000000/') is 'http://0x100000000/'
FAIL canonicalize('http://0xFF.0/') should be http://255.0.0.0/. Was http://0xFF.0/.
FAIL canonicalize('http://0xFF.0.0/') should be http://255.0.0.0/. Was http://0xFF.0.0/.
FAIL canonicalize('http://0xFF.0.0.0/') should be http://255.0.0.0/. Was http://0xFF.0.0.0/.
FAIL canonicalize('http://0.0xFF.0.0/') should be http://0.255.0.0/. Was http://0.0xFF.0.0/.
FAIL canonicalize('http://0.0.0xFF.0/') should be http://0.0.255.0/. Was http://0.0.0xFF.0/.
FAIL canonicalize('http://0.0.0.0xFF/') should be http://0.0.0.255/. Was http://0.0.0.0xFF/.
FAIL canonicalize('http://0.0.0xFFFF/') should be http://0.0.255.255/. Was http://0.0.0xFFFF/.
FAIL canonicalize('http://0.0xFFFFFF/') should be http://0.255.255.255/. Was http://0.0xFFFFFF/.
FAIL canonicalize('http://0xFFFFFFFF/') should be http://255.255.255.255/. Was http://0xFFFFFFFF/.
FAIL canonicalize('http://0xFF.0/') should be http://255.0.0.0/. Was http://0xff.0/.
FAIL canonicalize('http://0xFF.0.0/') should be http://255.0.0.0/. Was http://0xff.0.0/.
FAIL canonicalize('http://0xFF.0.0.0/') should be http://255.0.0.0/. Was http://0xff.0.0.0/.
FAIL canonicalize('http://0.0xFF.0.0/') should be http://0.255.0.0/. Was http://0.0xff.0.0/.
FAIL canonicalize('http://0.0.0xFF.0/') should be http://0.0.255.0/. Was http://0.0.0xff.0/.
FAIL canonicalize('http://0.0.0.0xFF/') should be http://0.0.0.255/. Was http://0.0.0.0xff/.
FAIL canonicalize('http://0.0.0xFFFF/') should be http://0.0.255.255/. Was http://0.0.0xffff/.
FAIL canonicalize('http://0.0xFFFFFF/') should be http://0.255.255.255/. Was http://0.0xffffff/.
FAIL canonicalize('http://0xFFFFFFFF/') should be http://255.255.255.255/. Was http://0xffffffff/.
PASS canonicalize('http://276.256.0xf1a2.077777/') is 'http://276.256.0xf1a2.077777/'
PASS canonicalize('http://192.168.0.257/') is 'http://192.168.0.257/'
PASS canonicalize('http://192.168.0xa20001/') is 'http://192.168.0xa20001/'
PASS canonicalize('http://192.015052000001/') is 'http://192.015052000001/'
FAIL canonicalize('http://0X12C0a80001/') should be http://0x12c0a80001/. Was http://0X12C0a80001/.
PASS canonicalize('http://0X12C0a80001/') is 'http://0x12c0a80001/'
PASS canonicalize('http://276.1.2/') is 'http://276.1.2/'
FAIL canonicalize('http://192.168.0.1 hello/') should be http://192.168.0.1%20hello/. Was http://192.168.0.1 hello/.
FAIL canonicalize('http://0000000000000300.0x00000000000000fF.00000000000000001/') should be http://192.255.0.1/. Was http://0000000000000300.0x00000000000000fF.00000000000000001/.
FAIL canonicalize('http://0000000000000300.0xffffffffFFFFFFFF.3022415481470977/') should be http://0000000000000300.0xffffffffffffffff.3022415481470977/. Was http://0000000000000300.0xffffffffFFFFFFFF.3022415481470977/.
FAIL canonicalize('http://0000000000000300.0x00000000000000fF.00000000000000001/') should be http://192.255.0.1/. Was http://0000000000000300.0x00000000000000ff.00000000000000001/.
PASS canonicalize('http://0000000000000300.0xffffffffFFFFFFFF.3022415481470977/') is 'http://0000000000000300.0xffffffffffffffff.3022415481470977/'
FAIL canonicalize('http://00000000000000000001/') should be http://0.0.0.1/. Was http://00000000000000000001/.
PASS canonicalize('http://0000000000000000100000000000000001/') is 'http://0000000000000000100000000000000001/'
PASS canonicalize('http://0.0.0.000000000000000000z/') is 'http://0.0.0.000000000000000000z/'
......
......@@ -19,7 +19,7 @@ PASS canonicalize('http://[1::]/') is 'http://[1::]/'
FAIL canonicalize('http://[::192.168.0.1]/') should be http://[::c0a8:1]/. Was http://[::192.168.0.1]/.
FAIL canonicalize('http://[::ffff:192.168.0.1]/') should be http://[::ffff:c0a8:1]/. Was http://[::ffff:192.168.0.1]/.
FAIL canonicalize('http://[000:01:02:003:004:5:6:007]/') should be http://[0:1:2:3:4:5:6:7]/. Was http://[000:01:02:003:004:5:6:007]/.
FAIL canonicalize('http://[A:b:c:DE:fF:0:1:aC]/') should be http://[a:b:c:de:ff:0:1:ac]/. Was http://[A:b:c:DE:fF:0:1:aC]/.
PASS canonicalize('http://[A:b:c:DE:fF:0:1:aC]/') is 'http://[a:b:c:de:ff:0:1:ac]/'
FAIL canonicalize('http://[1:0:0:2::3:0]/') should be http://[1::2:0:0:3:0]/. Was http://[1:0:0:2::3:0]/.
PASS canonicalize('http://[1::2:0:0:3:0]/') is 'http://[1::2:0:0:3:0]/'
PASS canonicalize('http://[::eeee:192.168.0.1]/') is 'http://[::eeee:192.168.0.1]/'
......
......@@ -53,10 +53,10 @@ PASS canonicalize(';/../bar') is 'http://host/bar'
PASS canonicalize('//another') is 'http://another/'
PASS canonicalize('//another/path?query#ref') is 'http://another/path?query#ref'
FAIL canonicalize('///another/path') should be http://another/path. Was http:/another/path.
FAIL canonicalize('//Another\\path') should be http://another/path. Was http://Another/path.
PASS canonicalize('//Another\\path') is 'http://another/path'
FAIL canonicalize('//') should be http:. Was http:/.
PASS canonicalize('\\/another/path') is 'http://another/path'
FAIL canonicalize('/\\Another\\path') should be http://another/path. Was http://Another/path.
PASS canonicalize('/\\Another\\path') is 'http://another/path'
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -3,7 +3,7 @@ Test resolution of relative UNIX-like URLs.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
FAIL canonicalize('\\\\Another\\path') should be http://another/path. Was http://Another/path.
PASS canonicalize('\\\\Another\\path') is 'http://another/path'
PASS canonicalize('/c:\\foo') is 'http://host/c:/foo'
FAIL canonicalize('//c:\\foo') should be http://c/foo. Was http://c:/foo.
PASS successfullyParsed is true
......
......@@ -6,7 +6,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS canonicalize('http://www.google.com/foo?bar=baz#') is 'http://www.google.com/foo?bar=baz#'
PASS canonicalize('http://[www.google.com]/') is 'http://[www.google.com]/'
FAIL canonicalize('http:////////user:@google.com:99?foo') should be http://user@google.com:99/?foo. Was http://////user:@google.com:99?foo.
FAIL canonicalize('http://192.0x00A80001') should be http://192.168.0.1/. Was http://192.0x00A80001/.
FAIL canonicalize('http://192.0x00A80001') should be http://192.168.0.1/. Was http://192.0x00a80001/.
FAIL canonicalize('http://www/foo%2Ehtml') should be http://www/foo.html. Was http://www/foo%2Ehtml.
PASS canonicalize('http://user:pass@/') is 'http://user:pass@/'
PASS canonicalize('http://%25DOMAIN:foobar@foodomain.com/') is 'http://%25DOMAIN:foobar@foodomain.com/'
......
2011-02-09 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
Hostnames should cannonicalize to lowercase (to match every other browser)
https://bugs.webkit.org/show_bug.cgi?id=54084
* platform/KURL.cpp:
(WebCore::KURL::parse):
2011-02-09 Peter Varga <pvarga@webkit.org>
......@@ -1331,7 +1331,7 @@ void KURL::parse(const char* url, const String* originalString)
strPtr = url + hostStart;
const char* hostEndPtr = url + hostEnd;
while (strPtr < hostEndPtr)
*p++ = *strPtr++;
*p++ = toASCIILower(*strPtr++);
}
m_hostEnd = p - buffer.data();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment