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" {
proto = "wheps"
}
path := parsed.Path
if path == "" || path == "/" {
path = "/"
path := strings.Trim(parsed.Path, "/")
if strings.HasPrefix(path, "whep/") {
path = strings.TrimPrefix(path, "whep/")
}
if !strings.HasSuffix(path, "/whep") {
if !strings.HasSuffix(path, "/") {
path += "/"
}
path += "whep"
path = strings.Trim(path, "/")
if path == "" {
path = "rovercam"
}
return fmt.Sprintf("%s://%s%s", proto, parsed.Host, path), nil
return fmt.Sprintf("%s://%s/%s/whep", proto, parsed.Host, path), nil
}
func ensureLeadingSlash(path string) string {