Feature/fix external subscription client expiry (#6333)

* fix(sub): honor client expiry for external links

* fix(ui): show client expiry on external links

* fix(sub): address external expiry review
This commit is contained in:
duqigit
2026-09-04 04:32:05 +08:00
committed by GitHub
parent 13e87a18c8
commit 2ddcf53020
16 changed files with 332 additions and 61 deletions
+4 -4
View File
@@ -345,7 +345,7 @@ func (a *SUBController) buildSubPageData(c *gin.Context) (PageData, bool) {
subReq := a.subService.ForRequest(host)
subReq.subscriptionBody = false
subs, emails, lastOnline, traffic, err := subReq.getSubs(subId)
if err != nil || len(subs) == 0 {
if err != nil || subs == nil {
writeSubError(c, err)
return PageData{}, false
}
@@ -413,7 +413,7 @@ func (a *SUBController) subs(c *gin.Context) {
subReq := a.subService.ForRequest(host)
subReq.subscriptionBody = true
subs, _, _, traffic, err := subReq.getSubs(subId)
if err != nil || len(subs) == 0 {
if err != nil || subs == nil {
writeSubError(c, err)
} else {
var result strings.Builder
@@ -742,7 +742,7 @@ func (a *SUBController) serveJsonBody(c *gin.Context, alwaysReturnArray bool, co
writeSubError(c, err)
return true
}
if len(jsonSub) == 0 {
if len(jsonSub) == 0 && header == "" {
return false
}
profileURL := fmt.Sprintf("%s://%s%s", scheme, hostWithPort, c.Request.RequestURI)
@@ -793,7 +793,7 @@ func (a *SUBController) serveClashBody(c *gin.Context, rawDownload bool) bool {
writeSubError(c, err)
return true
}
if len(clashSub) == 0 {
if len(clashSub) == 0 && header == "" {
return false
}
profileURL := fmt.Sprintf("%s://%s%s", scheme, hostWithPort, c.Request.RequestURI)