mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 18:26:35 +02:00
Removes any relay url that has the null byte, regardless of size
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user