test: add regression tests for 今北産業 URL crash (PR #1907)
Verifies that the Japanese phrase "今北産業" does not cause a StringIndexOutOfBoundsException in Url.getPart() and is not detected as a URL. https://claude.ai/code/session_013rJ9iYndYVJgpYK2VazxL2
This commit is contained in:
-12
@@ -293,18 +293,6 @@ class UrlParserTest {
|
||||
Urls(),
|
||||
)
|
||||
|
||||
/**
|
||||
* Regression test for PR #1907: a URL that ends with ':' causes readEnd() to trim it,
|
||||
* but the PORT marker index was already set to buffer.length (one past the trimmed URL).
|
||||
* Accessing host/port must not throw StringIndexOutOfBoundsException.
|
||||
*/
|
||||
@Test
|
||||
fun testUrlEndingWithColon() =
|
||||
test(
|
||||
"example.com:",
|
||||
Urls(),
|
||||
)
|
||||
|
||||
@Test
|
||||
fun testHour() =
|
||||
test(
|
||||
|
||||
Reference in New Issue
Block a user