Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KIT-CA
acme4netvs
Commits
cb2ba0cc
Verified
Commit
cb2ba0cc
authored
Sep 23, 2021
by
heiko.reese
💤
Browse files
Always drain and close http response body
parent
4f3330d5
Pipeline
#169211
passed with stages
in 1 minute
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
netvs_client.go
View file @
cb2ba0cc
...
...
@@ -122,6 +122,12 @@ func (c *NETVSClient) ExecuteTA(t Transaction) (TAResult, error) {
if
err
!=
nil
{
return
response
,
err
}
defer
func
()
{
// Drain and close the body to let the Transport reuse the connection
// see https://github.com/google/go-github/pull/317 for details
_
,
_
=
io
.
Copy
(
ioutil
.
Discard
,
resp
.
Body
)
_
=
resp
.
Body
.
Close
()
}()
// handle errors based on HTTP return code
switch
resp
.
StatusCode
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment