diff options
| author | Adam Soltys <[email protected]> | 2025-02-28 14:36:56 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-02-28 14:36:56 -0800 |
| commit | 5a91a3cbf1c03ee7b09b1e9570036e0db033ba2b (patch) | |
| tree | 94b0884d64cdaf771e4f58fd3ff6d14b4c2cd3da /src/lib | |
| parent | 7191e501f0a1860c79c53715be73904322e2fa67 (diff) | |
| download | coinos-ui-5a91a3cbf1c03ee7b09b1e9570036e0db033ba2b.tar.gz coinos-ui-5a91a3cbf1c03ee7b09b1e9570036e0db033ba2b.zip | |
handle nostr inputs
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/parse.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/parse.ts b/src/lib/parse.ts index 664cf17a..949b38db 100644 --- a/src/lib/parse.ts +++ b/src/lib/parse.ts @@ -21,6 +21,13 @@ export default async (s, host) => { } catch (e) {} } + if (t.toLowerCase().startsWith("nostr:")) { + t = t.split(":")[1]; + } + + if (["note", "nevent"].some((p) => t.startsWith(p))) redirect(307, `/e/${t}`); + if (["nprofile", "npub"].some((p) => t.startsWith(p))) redirect(307, `/${t}`); + // bitcoin if ( t.toLowerCase().startsWith("bitcoin:") || |
