Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit ad336c2

Browse files
committed
[integration-test] update curl command line for debug
1 parent f91cf9f commit ad336c2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

integration-cli/docker_utils.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,7 @@ func newRequestClient(method, endpoint string, data io.Reader, ct string) (*http
632632

633633
//init
634634
req.URL.Host = strings.Split(os.Getenv("DOCKER_HOST"), "://")[1]
635+
635636
if ct != "" {
636637
req.Header.Set("Content-Type", ct)
637638
}
@@ -650,12 +651,12 @@ func newRequestClient(method, endpoint string, data io.Reader, ct string) (*http
650651
fmt.Printf(" -H \"%v: %v\" \\\n", k, v[0])
651652
}
652653
fmt.Printf(" -X %v \\\n", method )
653-
if strings.Contains("POST|PUT",method) {
654+
if req.Body != nil {
654655
fmt.Printf(" -d '%v' \\\n", postData)
655656
}
656-
fmt.Printf(" https://%v/v1.23%v\n", strings.Split(os.Getenv("DOCKER_HOST"), "://")[1], debugEndpoint)
657-
fmt.Println("--------------------------------------------------------------------------------------------")
658657

658+
fmt.Printf(" https://%v%v\n", req.URL.Host, req.URL.RequestURI())
659+
fmt.Println("--------------------------------------------------------------------------------------------")
659660
//clear debugEndpoint
660661
debugEndpoint = ""
661662
}

0 commit comments

Comments
 (0)