diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-04-20 14:02:33 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-04-20 14:02:33 +0200 |
| commit | 5d3818161f635b82e3289e82ac1ab631f726566b (patch) | |
| tree | 4543f07a06a5f2f8ac2a5cd9963a271ed2a8b616 | |
| parent | 723ecacc8528be0e96db42392f1781ddf5894bea (diff) | |
HTTP: Explicitly close request to eliminate EOF errors
| -rw-r--r-- | src/http.go | 3 |
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) |
