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

Remove trailing / from server URIs #1551

Open
4 tasks done
bfops opened this issue Jul 26, 2024 · 2 comments
Open
4 tasks done

Remove trailing / from server URIs #1551

bfops opened this issue Jul 26, 2024 · 2 comments
Assignees

Comments

@bfops
Copy link
Collaborator

bfops commented Jul 26, 2024

If a user adds a server with trailing slash, they can get errors e.g.

Error: Unable to retrieve fingerprint for server: https://bitcraft.spacetimedb.org/
Is the server running?
Add a server without retrieving its fingerprint with:
        spacetime server add https://bitcraft.spacetimedb.org/ --no-fingerprint

Caused by:
    HTTP status client error (404 Not Found) for url (https://bitcraft.spacetimedb.org//identity/public-key)

(It ends up putting // in its URLs)

Definition of Done

The following places strip /s from server URIs before adding them and/or trying to use them:

  • CLI
  • Rust SDK
  • C# SDK (and Unity SDK)
  • TypeScript SDK
@bfops
Copy link
Collaborator Author

bfops commented Feb 7, 2025

The Rust SDK kind of does this properly. If I pass http://localhost:3000 or http://localhost:3000/, the SDK works fine; if I pass http://localhost:3000// then it breaks, and I think that that's reasonable behavior.

@bfops
Copy link
Collaborator Author

bfops commented Feb 7, 2025

The TypeScript SDK has similar behavior to the Rust SDK - if I pass http://localhost:3000 or http://localhost:3000/ it works, but http://localhost:3000// does not. Again I think that's reasonable behavior.

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