Skip to content

Commit

Permalink
Merge pull request #2 from april4/master
Browse files Browse the repository at this point in the history
use HEAD instead of GET
  • Loading branch information
mingcheng committed Jul 31, 2022
2 parents b271d20 + 99b10d0 commit 0fb8dd3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0fb8dd3

Please sign in to comment.