Browse Source

allow broadcast parameter for wine filter relay

imwald
Silberengel 4 months ago
parent
commit
290bf9c726
  1. 11
      src/lib/url.ts

11
src/lib/url.ts

@ -18,14 +18,13 @@ export function normalizeUrl(url: string): string {
// Parse the URL first to validate it // Parse the URL first to validate it
const p = new URL(url) const p = new URL(url)
// Check if URL has query parameters or hash fragments that suggest it's not a relay // Check if URL has hash fragments (these are not valid for relay URLs)
// Relay URLs shouldn't have query params like ?token= or hash fragments // Note: Query parameters are allowed (e.g., filter.nostr.wine uses ?broadcast=true/false)
const hasQueryParams = url.includes('?')
const hasHashFragment = url.includes('#') const hasHashFragment = url.includes('#')
// Block URLs with query params or hash fragments (these are likely not relays) // Block URLs with hash fragments (these are not valid for relays)
if (hasQueryParams || hasHashFragment) { if (hasHashFragment) {
logger.warn('Skipping URL with query/hash (not a relay)', { url }) logger.warn('Skipping URL with hash fragment (not a relay)', { url })
return '' return ''
} }

Loading…
Cancel
Save