From b55a7e028dd63c0d4d37ff6a5b55143c3b0581d2 Mon Sep 17 00:00:00 2001 From: Mei Akizuru Date: Wed, 18 Nov 2020 20:40:37 +0900 Subject: [PATCH] discard unauthorized response body (#403) --- v8/spnego/http.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/v8/spnego/http.go b/v8/spnego/http.go index 3971dbc1..53fe1a3d 100644 --- a/v8/spnego/http.go +++ b/v8/spnego/http.go @@ -116,6 +116,8 @@ func (c *Client) Do(req *http.Request) (resp *http.Response, err error) { // Refresh the body reader so the body can be sent again req.Body = ioutil.NopCloser(&body) } + io.Copy(ioutil.Discard, resp.Body) + resp.Body.Close() return c.Do(req) } return resp, err