Skip to content

Commit 7139710

Browse files
author
cyk
committed
fix(stream): 更新过期链接检查逻辑,支持所有4xx客户端错误
1 parent 64f01bf commit 7139710

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/stream/util.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ func IsLinkExpiredError(err error) bool {
6868
// Check for HTTP status codes that typically indicate expired links
6969
if statusErr, ok := errs.UnwrapOrSelf(err).(net.HttpStatusCodeError); ok {
7070
code := int(statusErr)
71-
// 401 Unauthorized, 403 Forbidden, 410 Gone are common for expired links
72-
// Note: Removed 500 to avoid false positives from temporary network errors
73-
if code == 401 || code == 403 || code == 410 {
71+
// All 4xx client errors may indicate expired/invalid links
72+
// 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 410 Gone, etc.
73+
if code >= 400 && code < 500 {
7474
return true
7575
}
7676
}

0 commit comments

Comments
 (0)