Skip to content

Commit

Permalink
fix: [api] fix check https:// suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
pinglin committed Dec 10, 2021
1 parent 71c6f3c commit c2ee3c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/cmd/api/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import (
)

func httpRequest(client *http.Client, hostname string, method string, p string, params interface{}, headers []string) (*http.Response, error) {

var requestURL string
if strings.Contains(p, "://") {
if strings.HasPrefix(p, "https://") {
requestURL = p
} else {
requestURL = instance.RESTPrefix(hostname) + strings.TrimPrefix(p, "/")
Expand Down

0 comments on commit c2ee3c9

Please sign in to comment.