Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
suchen-sci committed Dec 7, 2023
1 parent 776d48d commit cc21908
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cmd/client/general/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,10 @@ func HandleReqWithStreamResp(httpMethod string, path string, yamlBody []byte) (i

if strings.HasPrefix(url, HTTPProtocol) && resp.StatusCode == http.StatusBadRequest {
body, err := io.ReadAll(resp.Body)
resp.Body.Close()
if err != nil {
resp.Body.Close()
return nil, fmt.Errorf("read response body failed: %v", err)
}
resp.Body.Close()

// https://github.com/golang/go/blob/release-branch.go1.20/src/net/http/server.go#L1878-L1885
if strings.Contains(string(body), "Client sent an HTTP request to an HTTPS server") {
Expand Down

0 comments on commit cc21908

Please sign in to comment.