Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get bunker pubkey from pathname when hostname is empty #282

Merged
merged 1 commit into from
Dec 27, 2024

Conversation

purrgrammer
Copy link
Contributor

I'm running into an issue where the bunker pubkey is not set when trying to use bunker URLs from nsec.app like bunker://4b5893bff39aca8e3e3813c190156165e706d15d4f6136d718158ef957f26309?relay=wss://relay.nsec.app&secret=secret-value.

The hostname is empty and the pathname is //4b5893bff39aca8e3e3813c190156165e706d15d4f6136d718158ef957f26309. This PR makes sure to get the pubkey from pathname when the hostname is empty.

I'm running into an issue where the bunker pubkey is not set when trying to use bunker URLs from nsec.app like bunker://4b5893bff39aca8e3e3813c190156165e706d15d4f6136d718158ef957f26309?relay=wss://relay.nsec.app&secret=secret-value.

The `hostname` is empty and the `pathname` is `//4b5893bff39aca8e3e3813c190156165e706d15d4f6136d718158ef957f26309`. This PR makes sure to get the pubkey from pathname when the hostname is empty.
@pablof7z
Copy link
Collaborator

that's very strange 🤔

> const u = new URL('bunker://4b5893bff39aca8e3e3813c190156165e706d15d4f6136d718158ef957f26309?relay=wss://relay.nsec.app&secret=secret-value')
undefined
> u.hostname
'4b5893bff39aca8e3e3813c190156165e706d15d4f6136d718158ef957f26309'

@purrgrammer
Copy link
Contributor Author

That's node, on the browser (Chrome and Firefox) I'm having this issue. Not sure if it's because my OS (I'm on Mac OS).

@purrgrammer
Copy link
Contributor Author

related #285

@pablof7z pablof7z merged commit 1762784 into nostr-dev-kit:master Dec 27, 2024
asoltys pushed a commit to asoltys/ndk that referenced this pull request Jan 3, 2025
…#282)

I'm running into an issue where the bunker pubkey is not set when trying to use bunker URLs from nsec.app like bunker://4b5893bff39aca8e3e3813c190156165e706d15d4f6136d718158ef957f26309?relay=wss://relay.nsec.app&secret=secret-value.

The `hostname` is empty and the `pathname` is `//4b5893bff39aca8e3e3813c190156165e706d15d4f6136d718158ef957f26309`. This PR makes sure to get the pubkey from pathname when the hostname is empty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants