From 99b10d03238c49f25ab5a9732c9632fa4c1d5231 Mon Sep 17 00:00:00 2001 From: april4 Date: Mon, 18 Jul 2022 00:31:20 +0800 Subject: [PATCH] use HEAD instead of GET --- backend.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend.go b/backend.go index abaec32..14486b5 100644 --- a/backend.go +++ b/backend.go @@ -52,8 +52,8 @@ func (b *Backend) Check() (err error) { return } - resp, err = client.Get(url) - if err != nil || (resp != nil && resp.StatusCode != http.StatusOK) { + resp, err = client.Head(url) + if err != nil || (resp != nil && resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusMovedPermanently && resp.StatusCode != http.StatusFound) { log.Error(err) b.alive = false } else {