Making a localhost:3030 string work correctly in the URL Detector

This commit is contained in:
Vitor Pamplona
2026-03-27 19:34:55 -04:00
parent 49f0ca30b2
commit ea8fbd4af9
3 changed files with 9 additions and 5 deletions
@@ -89,5 +89,7 @@ class URIReferenceNormalizerTest {
// Already normalized
assertEquals("http://example.com/~user", Rfc3986.normalize("http://example.com/~user"))
assertEquals("wss://localhost:3030/", Rfc3986.normalize("wss://localhost:3030"))
}
}
@@ -474,10 +474,6 @@ class UriDetectionTest {
@Test
fun testIpv6BadWithGoodUrlsEmbedded() {
runTest(
"[fe80:aaaa:aaaa:aaaa:[::]3dd0:7f8e:57b7:34d5f]",
"[::]",
)
runTest("[b[::7f8e]:55]akjef[::]", "[::7f8e]:55", "[::]")
runTest(
"[bcad::kkkk:aaaa:3dd0[::7f8e]:57b7:34d5]akjef[::]",
@@ -739,6 +735,11 @@ class UriDetectionTest {
runTest("blossom:9584b6d64e43747364b10276f4b821e5df09f46477b3b8c60cced3e8c647fbef.jpg?xs=blossom.primal.net", "blossom:9584b6d64e43747364b10276f4b821e5df09f46477b3b8c60cced3e8c647fbef.jpg?xs=blossom.primal.net")
}
@Test
fun testLocalHost() {
runTest("wss://localhost:3030", "wss://localhost:3030")
}
@Test
fun testBrokenCaseInProduction() {
runTest("今北産業")