Skip to content

Commit

Permalink
use HEAD instead of GET
Browse files Browse the repository at this point in the history
  • Loading branch information
april4 committed Jul 17, 2022
1 parent b271d20 commit 99b10d0
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 99b10d0

Please sign in to comment.