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

private connections authentication breaks when encrypt_internal_message returns a string with the path separator #30

Open
riccardobl opened this issue Jul 21, 2024 · 0 comments

Comments

@riccardobl
Copy link

From my tests it seems that when using a private connection from an extension

relay_endpoint = encrypt_internal_message("relay")
relay=f"ws://localhost:{settings.port}/nostrclient/api/v1/{relay_endpoint}"

the authentication fails with

server rejected WebSocket connection: HTTP 403

(using the 'websockets' lib)
if encrypt_internal_message happens to return a string with the '/' character inside.
I've tried to urlencode it with

urllib.parse.quote(relay_endpoint, safe='')

but the connection was still rejected, i assume it's because the '/' character in path components is not automatically urldecoded.

Imo it would be better to pass it as query parameter instead of path.

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

No branches or pull requests

1 participant