two url fixes:

- default scheme for legacy connection params
- set paths for http and websocket APIs
This commit is contained in:
Sam Lewis
2025-01-19 20:58:16 -05:00
parent c27e596dad
commit 56ccdfbdb2
3 changed files with 6 additions and 0 deletions
+1
View File
@@ -18,6 +18,7 @@ type HttpClient struct {
func NewHttpClient(url *url.URL, token string) *HttpClient {
// Shallow copy the URL to avoid modifying the original
u := *url
u.Path = "/api"
if u.Scheme == "ws" {
u.Scheme = "http"
}
+1
View File
@@ -51,6 +51,7 @@ func ConnectionFromUri(baseURL *url.URL, authToken string) (*websocket.Conn, con
// Shallow copy the URL to avoid modifying the original
urlWebsockets := *baseURL
urlWebsockets.Path = "/api/websocket"
if baseURL.Scheme == "http" {
urlWebsockets.Scheme = "ws"
}