Removes any relay url that has the null byte, regardless of size

This commit is contained in:
Vitor Pamplona
2025-09-02 18:28:14 -04:00
parent fb5c20d8da
commit 116bd1ae29

View File

@@ -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)