Trim cache key prefixes and the relay protocols, before using them

This commit is contained in:
Daniele Tonon
2024-01-03 12:26:43 +01:00
parent b7db88cf09
commit 7ad5ac2984

View File

@@ -55,10 +55,10 @@ func renderArchive(w http.ResponseWriter, r *http.Request) {
data := []string{} data := []string{}
for i := 0; i < len(keys); i++ { for i := 0; i < len(keys); i++ {
if area == "npubs-archive" { if area == "npubs-archive" {
npub, _ := nip19.EncodePublicKey(keys[i]) npub, _ := nip19.EncodePublicKey(keys[i][3:])
data = append(data, npub) data = append(data, npub)
} else { } else {
data = append(data, keys[i]) data = append(data, trimProtocol(keys[i][3:]))
} }
} }