mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
Improved url online checking logic (#10206)
Improved url online checking logic. When 401 is returned, it can also be recognized as online
This commit is contained in:
parent
540af4051b
commit
9c703d0016
1 changed files with 5 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue