Changeset 206614 in webkit
- Timestamp:
- Sep 29, 2016, 2:20:43 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r206611 r206614 1 2016-09-29 Alex Christensen <achristensen@webkit.org> 2 3 URLParser should correctly parse ports with leading 0's 4 https://bugs.webkit.org/show_bug.cgi?id=162752 5 6 Reviewed by Tim Horton. 7 8 Covered by new API tests. 9 10 * platform/URLParser.cpp: 11 (WebCore::URLParser::parsePort): 12 1 13 2016-09-29 Commit Queue <commit-queue@webkit.org> 2 14 -
trunk/Source/WebCore/platform/URLParser.cpp
r206609 r206614 2362 2362 return true; 2363 2363 } 2364 bool seenDigit = false; 2365 bool seenMultipleDigits = false; 2366 bool leadingZeros = false; 2364 2367 for (; !iterator.atEnd(); ++iterator) { 2365 2368 if (UNLIKELY(isTabOrNewline(*iterator))) { … … 2368 2371 } 2369 2372 if (isASCIIDigit(*iterator)) { 2373 if (*iterator == '0' && !seenDigit) 2374 leadingZeros = true; 2375 if (seenDigit) 2376 seenMultipleDigits = true; 2377 seenDigit = true; 2370 2378 port = port * 10 + *iterator - '0'; 2371 2379 if (port > std::numeric_limits<uint16_t>::max()) … … 2374 2382 return false; 2375 2383 } 2384 2385 if (port && leadingZeros) 2386 syntaxViolation(colonIterator); 2387 2388 if (!port && seenMultipleDigits) 2389 syntaxViolation(colonIterator); 2376 2390 2377 2391 if (UNLIKELY(isDefaultPort(parsedDataView(0, m_url.m_schemeEnd), port))) -
trunk/Tools/ChangeLog
r206609 r206614 1 2016-09-29 Alex Christensen <achristensen@webkit.org> 2 3 URLParser should correctly parse ports with leading 0's 4 https://bugs.webkit.org/show_bug.cgi?id=162752 5 6 Reviewed by Tim Horton. 7 8 * TestWebKitAPI/Tests/WebCore/URLParser.cpp: 9 (TestWebKitAPI::TEST_F): 10 1 11 2016-09-29 Alex Christensen <achristensen@webkit.org> 2 12 -
trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp
r206609 r206614 397 397 checkRelativeURL(String(), "http://webkit.org/", {"http", "", "", "webkit.org", 0, "/", "", "", "http://webkit.org/"}); 398 398 checkRelativeURL("https://@test@test@example:800\\path@end", "http://doesnotmatter/", {"", "", "", "", 0, "", "", "", "https://@test@test@example:800\\path@end"}); 399 checkRelativeURL("http://f:0/c", "http://example.org/foo/bar", {"http", "", "", "f", 0, "/c", "", "", "http://f:0/c"}); 399 400 400 401 // The checking of slashes in SpecialAuthoritySlashes needed to get this to pass contradicts what is in the spec, … … 767 768 {"http", "", "", "127.0.1.~", 0, "/", "", "", "http://127.0.1.~/"}, 768 769 {"", "", "", "", 0, "", "", "", "http://127.0.1.~"}); 770 checkRelativeURLDifferences("http://f:000/c", "http://example.org/foo/bar", 771 {"http", "", "", "f", 0, "/c", "", "", "http://f:0/c"}, 772 {"http", "", "", "f", 0, "/c", "", "", "http://f:000/c"}); 773 checkRelativeURLDifferences("http://f:010/c", "http://example.org/foo/bar", 774 {"http", "", "", "f", 10, "/c", "", "", "http://f:10/c"}, 775 {"http", "", "", "f", 10, "/c", "", "", "http://f:010/c"}); 769 776 } 770 777
Note:
See TracChangeset
for help on using the changeset viewer.