mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-22 21:51:57 +02:00
Merge pull request #946 from greenart7c3/main
check for localhost when adding a new relay
This commit is contained in:
@@ -31,7 +31,9 @@ class RelayUrlFormatter {
|
||||
fun normalize(url: String): String {
|
||||
val newUrl =
|
||||
if (!url.startsWith("wss://") && !url.startsWith("ws://")) {
|
||||
if (url.endsWith(".onion") || url.endsWith(".onion/")) {
|
||||
// TODO: How to identify relays on the local network?
|
||||
val isLocalHost = url.contains("127.0.0.1") || url.contains("localhost")
|
||||
if (url.endsWith(".onion") || url.endsWith(".onion/") || isLocalHost) {
|
||||
"ws://${url.trim()}"
|
||||
} else {
|
||||
"wss://${url.trim()}"
|
||||
|
Reference in New Issue
Block a user