From 53740d00267826e7dc6b2844b4b854cb48ec61d6 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 28 Apr 2020 02:13:02 +0300 Subject: [PATCH] lib/promscrape: handle connection reset when targets responds with http redirect --- lib/promscrape/client.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/promscrape/client.go b/lib/promscrape/client.go index fdafb0cd0a..0cfb342877 100644 --- a/lib/promscrape/client.go +++ b/lib/promscrape/client.go @@ -133,15 +133,6 @@ var ( func doRequestWithPossibleRetry(hc *fasthttp.HostClient, req *fasthttp.Request, resp *fasthttp.Response) error { // There is no need in calling DoTimeout, since the timeout must be already set in hc.ReadTimeout. err := hc.Do(req, resp) - if err == nil && (resp.Header.StatusCode() == 301 || resp.Header.StatusCode() == 302) { - l := string(resp.Header.Peek("Location")) - if l != "" { - req.URI().Update(l) - // only redirect once - err = hc.Do(req, resp) - } - } - if err == nil { return nil }