File tree 1 file changed +3
-6
lines changed
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -28,22 +28,19 @@ const (
28
28
// ClientUrl returns a URL with the given hostname in the format of `https://<hostname>/edge/management/v1`.
29
29
// The hostname provided may include a port.
30
30
func ClientUrl (hostname string ) string {
31
- if ! strings .Contains (hostname , "://" ) {
32
- hostname = "https://" + hostname
33
- }
34
31
return concat (hostname , ClientApiPath )
35
32
}
36
33
37
34
// ManagementUrl returns a URL with the given hostname in the format of `https://<hostname>/edge/management/v1`.
38
35
// The hostname provided may include a port.
39
36
func ManagementUrl (hostname string ) string {
40
- if ! strings .Contains (hostname , "://" ) {
41
- hostname = "https://" + hostname
42
- }
43
37
return concat (hostname , ManagementApiPath )
44
38
}
45
39
46
40
func concat (base , path string ) string {
41
+ if ! strings .Contains (base , "://" ) {
42
+ base = "https://" + base
43
+ }
47
44
if strings .HasSuffix (base , "/" ) {
48
45
return strings .Trim (base , "/" ) + path
49
46
}
You can’t perform that action at this time.
0 commit comments