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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

purrgrammer
Copy link

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'

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