Skip to content

Commit 738c3fa

Browse files
committed
fix(cephfs): support http
1 parent 100bd85 commit 738c3fa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/multicloud/cephfs/client.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ func (cli *SCephFSClient) getDefaultClient() *http.Client {
120120
}
121121

122122
func (cli *SCephFSClient) baseUrl() string {
123-
return fmt.Sprintf("https://%s:%d/api", cli.host, cli.port)
123+
protocol := "http"
124+
if strings.Contains(fmt.Sprintf("%d", cli.port), "443") {
125+
protocol = "https"
126+
}
127+
return fmt.Sprintf("%s://%s:%d/api", protocol, cli.host, cli.port)
124128
}
125129

126130
func (cli *SCephFSClient) auth() error {

0 commit comments

Comments
 (0)