summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-04-20 14:02:33 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-04-20 14:02:33 +0200
commit5d3818161f635b82e3289e82ac1ab631f726566b (patch)
tree4543f07a06a5f2f8ac2a5cd9963a271ed2a8b616
parent723ecacc8528be0e96db42392f1781ddf5894bea (diff)
HTTP: Explicitly close request to eliminate EOF errors
-rw-r--r--src/http.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/http.go b/src/http.go
index 8243500..b247dbb 100644
--- a/src/http.go
+++ b/src/http.go
@@ -142,6 +142,9 @@ func HTTPMethodWithOpts(method string, url string, opts *HTTPOptionalParams) (ht
return nil, nil, &HTTPRequestCreateError{URL: url, Err: reqErr}
}
+ // See https://stackoverflow.com/questions/17714494/golang-http-request-results-in-eof-errors-when-making-multiple-requests-successi
+ req.Close = true
+
// Make sure the headers contain all the parameters
httpOptionalHeaders(req, opts)