Skip to content

Commit

Permalink
Improved url online checking logic (#10206)
Browse files Browse the repository at this point in the history
Improved url online checking logic. When 401 is returned, it can also be recognized as online
  • Loading branch information
pinghe authored Jan 17, 2024
1 parent 540af40 commit 9c703d0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel/util/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ func isOnline(checkURL string, skipTlsVerify bool) (ret bool) {

for i := 0; i < 3; i++ {
resp, err := c.R().Get(checkURL)

if resp.StatusCode == 401 {
return true
}

if resp.GetHeader("Location") != "" {
return true
}
Expand Down

0 comments on commit 9c703d0

Please sign in to comment.