Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 362ddc7

Browse files
author
Russtopia
committed
Enabled error response JSON body output
1 parent 11f797a commit 362ddc7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

internal/entclient/devurl.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ func (c Client) DelDevURL(envID, urlID string) error {
2222
if err != nil {
2323
return err
2424
}
25+
defer res.Body.Close()
2526

2627
if res.StatusCode != http.StatusOK {
2728
return bodyError(res)
@@ -51,6 +52,7 @@ func (c Client) InsertDevURL(envID string, port int, name, access string) error
5152
if err != nil {
5253
return err
5354
}
55+
defer res.Body.Close()
5456

5557
if res.StatusCode != http.StatusOK {
5658
return bodyError(res)
@@ -80,6 +82,7 @@ func (c Client) UpdateDevURL(envID, urlID string, port int, name, access string)
8082
if err != nil {
8183
return err
8284
}
85+
defer res.Body.Close()
8386

8487
if res.StatusCode != http.StatusOK {
8588
return bodyError(res)

internal/entclient/error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
func bodyError(resp *http.Response) error {
11-
byt, err := httputil.DumpResponse(resp, false)
11+
byt, err := httputil.DumpResponse(resp, true)
1212
if err != nil {
1313
return xerrors.Errorf("dump response: %w", err)
1414
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy