hzrd149 / nostrudel

A sandbox for exploring nostr
https://nostrudel.ninja/
MIT License
126 stars 38 forks source link

Fix bunker url parsing on mac/ios #131

Closed nostrband closed 6 months ago

hzrd149 commented 7 months ago

Thanks for the PR but I don't think this is due to a difference on mac/ios. I took another look at the fromBunkerURI method and it looks like it doesn't handle bunker://pubkey?relay=wss://realy URIs. so in other words its broken. I updated it on 3a8bea9bc0cf52fe1b41c0a69c7377a1612aed66 and pushed the changes to next.nostrudel.ninja

I tested it locally with use.nsec.app and it seems to be working now

nostrband commented 7 months ago

next.nostrudel.ninja doesn't work for me now. Here is how a parsed bunker URL looks on Ubuntu/Chrome and Windows/Chrome:

hash: "" host: "" hostname: "" href: "bunker://3356de61b39647931ce8b2140b2bab837e0810c0ef515bbe92de0248040b8bdd?relay=wss://relay.nsec.app" origin: "null" password: "" pathname: "//3356de61b39647931ce8b2140b2bab837e0810c0ef515bbe92de0248040b8bdd" port: "" protocol: "bunker:" search: "?relay=wss://relay.nsec.app" searchParams: URLSearchParams {size: 1} username: ""

hzrd149 commented 7 months ago

Just tested chrome and it looks like its a difference between how FireFox and Chrome handle bunker:// urls. I added pathname back in as a fallback for getting the pubkey https://github.com/hzrd149/nostrudel/commit/bbba484ce0b443af0b8f449d283c35d2cfab171f

nostrband commented 7 months ago

Next working for me now.

hzrd149 commented 6 months ago

Closing PR since changes are working in "next" version