mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 01:21:20 -04:00
fix pi rover?
This commit is contained in:
Vendored
BIN
Binary file not shown.
+7
-9
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user