Changeset 236527 in webkit
- Timestamp:
- Sep 26, 2018, 2:56:31 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/DOMURL/parsing-expected.txt (modified) (1 diff)
-
LayoutTests/fast/dom/DOMURL/parsing.html (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/URLParser.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r236519 r236527 1 2018-09-26 Alex Christensen <achristensen@webkit.org> 2 3 uidna_nameToASCII only needs a buffer capacity of 64 4 https://bugs.webkit.org/show_bug.cgi?id=190006 5 6 Reviewed by Chris Dumez. 7 8 * fast/dom/DOMURL/parsing.html: 9 1 10 2018-09-26 Ryosuke Niwa <rniwa@webkit.org> 2 11 -
trunk/LayoutTests/fast/dom/DOMURL/parsing-expected.txt
r207162 r236527 15 15 PASS breakDownURL('http://ex%61mple.com/') is 'protocol=http:, host=example.com, pathname=/, origin=http://example.com, toString=http://example.com/' 16 16 PASS breakDownURL('http://ex%2fmple.com/') threw exception TypeError: Type error. 17 PASS i is 54 17 18 PASS successfullyParsed is true 18 19 -
trunk/LayoutTests/fast/dom/DOMURL/parsing.html
r207162 r236527 58 58 shouldThrow("breakDownURL('http://ex%2fmple.com/')"); 59 59 60 var longUnicodeDomain = "\u1234"; 61 var i = 0; 62 try { 63 for (i = 0; i < 100; ++i) { 64 longUnicodeDomain += "a" 65 new URL("http://" + longUnicodeDomain + "/"); 66 } 67 } catch (e) { } 68 shouldBe("i", "54"); 69 60 70 </script> -
trunk/Source/WebCore/ChangeLog
r236524 r236527 1 2018-09-26 Alex Christensen <achristensen@webkit.org> 2 3 uidna_nameToASCII only needs a buffer capacity of 64 4 https://bugs.webkit.org/show_bug.cgi?id=190006 5 6 Reviewed by Chris Dumez. 7 8 This is specified in https://www.unicode.org/reports/tr46/#ToASCII 9 This is how Chrome and Firefox also behave with long unicode hosts. 10 11 * platform/URLParser.cpp: 12 (WebCore::URLParser::domainToASCII): 13 1 14 2018-09-26 Alex Christensen <achristensen@webkit.org> 2 15 -
trunk/Source/WebCore/platform/URLParser.cpp
r233789 r236527 621 621 void URLParser::encodeQuery(const Vector<UChar>& source, const TextEncoding& encoding, CodePointIterator<CharacterType> iterator) 622 622 { 623 // FIXME: It is unclear in the spec what to do when encoding fails. The behavior should be specified and tested.624 623 auto encoded = encoding.encode(StringView(source.data(), source.size()), UnencodableHandling::URLEncodedEntities); 625 624 auto* data = encoded.data(); … … 2569 2568 } 2570 2569 2571 UChar hostnameBuffer[defaultInlineBufferSize]; 2570 const size_t maxDomainLength = 64; 2571 UChar hostnameBuffer[maxDomainLength]; 2572 2572 UErrorCode error = U_ZERO_ERROR; 2573 2573 UIDNAInfo processingDetails = UIDNA_INFO_INITIALIZER; 2574 int32_t numCharactersConverted = uidna_nameToASCII(&internationalDomainNameTranscoder(), StringView(domain).upconvertedCharacters(), domain.length(), hostnameBuffer, defaultInlineBufferSize, &processingDetails, &error);2575 ASSERT(numCharactersConverted <= static_cast<int32_t>( defaultInlineBufferSize));2574 int32_t numCharactersConverted = uidna_nameToASCII(&internationalDomainNameTranscoder(), StringView(domain).upconvertedCharacters(), domain.length(), hostnameBuffer, maxDomainLength, &processingDetails, &error); 2575 ASSERT(numCharactersConverted <= static_cast<int32_t>(maxDomainLength)); 2576 2576 2577 2577 if (U_SUCCESS(error) && !processingDetails.errors) { … … 2585 2585 return ascii; 2586 2586 } 2587 2588 // FIXME: Check for U_BUFFER_OVERFLOW_ERROR and retry with an allocated buffer.2589 2587 return std::nullopt; 2590 2588 }
Note:
See TracChangeset
for help on using the changeset viewer.