mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-17 01:50:47 -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" {
|
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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user