fix pi rover?

This commit is contained in:
legop3
2025-11-14 02:11:57 -05:00
parent c0dce561bd
commit 588c7aa571
2 changed files with 7 additions and 9 deletions
Vendored
BIN
View File
Binary file not shown.
+7 -9
View File
@@ -164,17 +164,15 @@ func buildBridgeURL(src string) (string, error) {
if parsed.Scheme == "https" { if parsed.Scheme == "https" {
proto = "wheps" proto = "wheps"
} }
path := parsed.Path path := strings.Trim(parsed.Path, "/")
if path == "" || path == "/" { if strings.HasPrefix(path, "whep/") {
path = "/" path = strings.TrimPrefix(path, "whep/")
} }
if !strings.HasSuffix(path, "/whep") { path = strings.Trim(path, "/")
if !strings.HasSuffix(path, "/") { if path == "" {
path += "/" path = "rovercam"
} }
path += "whep" return fmt.Sprintf("%s://%s/%s/whep", proto, parsed.Host, path), nil
}
return fmt.Sprintf("%s://%s%s", proto, parsed.Host, path), nil
} }
func ensureLeadingSlash(path string) string { func ensureLeadingSlash(path string) string {