Method
isRelayUrlMatch
(clientRelay: string, serverRelay: string)
Source from the content-addressed store, hash-verified
| 75 | |
| 76 | // NIP-42 says domain-match is sufficient for relay URL comparison |
| 77 | private isRelayUrlMatch(clientRelay: string, serverRelay: string): boolean { |
| 78 | try { |
| 79 | const clientHost = new URL(clientRelay).hostname.toLowerCase() |
| 80 | const serverHost = new URL(serverRelay).hostname.toLowerCase() |
| 81 | return clientHost === serverHost |
| 82 | } catch { |
| 83 | return false |
| 84 | } |
| 85 | } |
| 86 | } |
Tested by
no test coverage detected