diff --git a/dist/roverd b/dist/roverd index 0a594ed8..838b6f96 100755 Binary files a/dist/roverd and b/dist/roverd differ diff --git a/pi/roverd/config.go b/pi/roverd/config.go index c1684bd8..aad5162b 100644 --- a/pi/roverd/config.go +++ b/pi/roverd/config.go @@ -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 {