mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 08:00: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++ {
|
for i := 0; i < 3; i++ {
|
||||||
resp, err := c.R().Get(checkURL)
|
resp, err := c.R().Get(checkURL)
|
||||||
|
|
||||||
|
if resp.StatusCode == 401 {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
if resp.GetHeader("Location") != "" {
|
if resp.GetHeader("Location") != "" {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue