From 116bd1ae296a7ee2c042ee3f89cb1ef608bb4c3b Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 2 Sep 2025 18:28:14 -0400 Subject: [PATCH] Removes any relay url that has the null byte, regardless of size --- .../quartz/nip01Core/relay/normalizer/RelayUrlNormalizer.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip01Core/relay/normalizer/RelayUrlNormalizer.kt b/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip01Core/relay/normalizer/RelayUrlNormalizer.kt index 1729f4886..c417c8f81 100644 --- a/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip01Core/relay/normalizer/RelayUrlNormalizer.kt +++ b/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip01Core/relay/normalizer/RelayUrlNormalizer.kt @@ -94,9 +94,9 @@ class RelayUrlNormalizer { @OptIn(ExperimentalContracts::class) fun fix(url: String): String? { if (url.length < 4) return null - if (url.length > 50) { - if (url.indexOf("%00") > -1) return null + if (url.contains("%00")) return null + if (url.length > 50) { // removes multiple urls in the same line val schemeIdx = url.indexOf("://") val nextScheme = url.indexOf("://", schemeIdx + 3)