Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyangyu committed Aug 31, 2024
1 parent c0bc58b commit dcba4f9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/service/cloud/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,9 @@ type DebugTransport struct {
}

func (dt *DebugTransport) RoundTrip(r *http.Request) (*http.Response, error) {
if os.Getenv(config.DebugEnv) == "true" || os.Getenv(config.DebugEnv) == "1" {
debug := os.Getenv(config.DebugEnv) == "true" || os.Getenv(config.DebugEnv) == "1"

if debug {
dump, err := httputil.DumpRequestOut(r, true)
if err != nil {
return nil, err
Expand All @@ -483,7 +485,7 @@ func (dt *DebugTransport) RoundTrip(r *http.Request) (*http.Response, error) {
return resp, err
}

if os.Getenv(config.DebugEnv) == "true" || os.Getenv(config.DebugEnv) == "1" {
if debug {
dump, err := httputil.DumpResponse(resp, true)
if err != nil {
return resp, err
Expand Down

0 comments on commit dcba4f9

Please sign in to comment.