Skip to content

Commit ecfe56c

Browse files
committed
Read the reply from POST to force connection to close
1 parent 39284d8 commit ecfe56c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

splunk/splunk.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ func (c *Client) doRequest(b *bytes.Buffer) error {
164164
// If statusCode is not good, return error string
165165
switch res.StatusCode {
166166
case 200:
167+
// need to read the reply otherwise the connection hangs
168+
buf := new(bytes.Buffer)
169+
buf.ReadFrom(res.Body)
170+
167171
return nil
168172
default:
169173
// Turn response into string and return it

0 commit comments

Comments
 (0)