Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Strip trailing
/
from URIs before connecting (#238)
## Description of Changes We were not stripping `/` from the end of URIs provided to `Connect`. We manually append `/...` to the provided addresses, so if we don't start by stripping trailing `/`s, we end up with `//` in the URI and we get errors. Addresses part of clockworklabs/SpacetimeDB#1551. ## API No breaking changes. This fixes an error case. ## Requires SpacetimeDB PRs None ## Testsuite SpacetimeDB branch name: master ## Testing - [x] Tested the quickstart chat client with a host containing a trailing `/` ``` # start a server, publish the module, send some input # I also updated one line in `client.csproj` to use `Net8.0` because I no longer have `Net7.0` installed $ cd examples~/quickstart/client $ dotnet run [I] SpacetimeDBClient: Connecting to ws://localhost:3000 quickstart-chat C200098E is online Connected C2007471: hello C2007471: godo C2007471: asdf $ sed -i 's/localhost:3000/localhost:3000\//' Program.cs $ dotnet run [I] SpacetimeDBClient: Connecting to ws://localhost:3000 quickstart-chat C2000601 is online Connected C2007471: hello C2007471: godo C2007471: asdf $ git diff diff --git a/examples~/quickstart/client/Program.cs b/examples~/quickstart/client/Program.cs index 9eb43b1..289e736 100644 --- a/examples~/quickstart/client/Program.cs +++ b/examples~/quickstart/client/Program.cs @@ -7,8 +7,8 @@ using System.Threading; using SpacetimeDB; using SpacetimeDB.Types; -const string HOST = "http://localhost:3000"; -const string DBNAME = "chatqs"; +const string HOST = "http://localhost:3000/"; +const string DBNAME = "quickstart-chat"; // our local client SpacetimeDB identity Identity? local_identity = null; diff --git a/examples~/quickstart/client/client.csproj b/examples~/quickstart/client/client.csproj index 48917cc..ab7ce44 100644 --- a/examples~/quickstart/client/client.csproj +++ b/examples~/quickstart/client/client.csproj @@ -2,7 +2,7 @@ <PropertyGroup> <OutputType>Exe</OutputType> - <TargetFramework>net7.0</TargetFramework> + <TargetFramework>net8.0</TargetFramework> <CheckEolTargetFramework>false</CheckEolTargetFramework> <ImplicitUsings>disable</ImplicitUsings> <Nullable>enable</Nullable> ``` --------- Co-authored-by: Zeke Foppa <[email protected]>
- Loading branch information