mirror of
https://github.com/lumina-rocks/lumina.git
synced 2026-06-05 02:01:47 +02:00
fix: sanitize relay URLs by removing trailing slashes
This commit is contained in:
@@ -34,6 +34,11 @@ export function AddRelaySheet({ onRelayAdded }: AddRelaySheetProps) {
|
||||
if (!formattedUrl.startsWith("wss://")) {
|
||||
formattedUrl = `wss://${formattedUrl}`;
|
||||
}
|
||||
|
||||
// Remove trailing slash if present
|
||||
if (formattedUrl.endsWith('/')) {
|
||||
formattedUrl = formattedUrl.slice(0, -1);
|
||||
}
|
||||
|
||||
// Check if relay already exists in connected relays
|
||||
const existingRelays = connectedRelays?.map(relay => relay.url) || [];
|
||||
|
||||
Reference in New Issue
Block a user