From 84a689cf1066904c2f6084fcb3bb4bf406c42922 Mon Sep 17 00:00:00 2001 From: spokyle <61868710+spokyle@users.noreply.github.com> Date: Sat, 30 May 2026 20:40:18 +0800 Subject: [PATCH] feat(sub): add HEAD method support for subscription endpoints (#4684) Allow clients to retrieve Subscription-Userinfo header via lightweight HEAD requests without downloading the full response body. This enables traffic monitoring tools and proxy clients to check quota usage more efficiently. --- sub/subController.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sub/subController.go b/sub/subController.go index e5ef6d48..805f048a 100644 --- a/sub/subController.go +++ b/sub/subController.go @@ -101,13 +101,16 @@ func NewSUBController( func (a *SUBController) initRouter(g *gin.RouterGroup) { gLink := g.Group(a.subPath) gLink.GET(":subid", a.subs) + gLink.HEAD(":subid", a.subs) if a.jsonEnabled { gJson := g.Group(a.subJsonPath) gJson.GET(":subid", a.subJsons) + gJson.HEAD(":subid", a.subJsons) } if a.clashEnabled { gClash := g.Group(a.subClashPath) gClash.GET(":subid", a.subClashs) + gClash.HEAD(":subid", a.subClashs) } }