mirror of
https://github.com/bestnite/sub2clash.git
synced 2025-07-04 11:52:34 +08:00
Fix subscription user info header handling in SubHandler to only set header on successful fetch
This commit is contained in:
@ -27,11 +27,10 @@ func SubHandler(model M.ClashType, template string) func(c *gin.Context) {
|
||||
|
||||
if len(query.Subs) == 1 {
|
||||
userInfoHeader, err := common.FetchSubscriptionUserInfo(query.Subs[0], "clash", config.GlobalConfig.RequestRetryTimes)
|
||||
if err != nil {
|
||||
c.String(http.StatusInternalServerError, err.Error())
|
||||
}
|
||||
if err == nil {
|
||||
c.Header("subscription-userinfo", userInfoHeader)
|
||||
}
|
||||
}
|
||||
|
||||
if query.NodeListMode {
|
||||
nodelist := M.NodeList{}
|
||||
|
Reference in New Issue
Block a user