From 5822758b7c2431f8f952432a4e67cd0c2c6237e1 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Wed, 24 Sep 2025 19:51:01 +0200 Subject: tiny changes --- sub/subController.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'sub/subController.go') diff --git a/sub/subController.go b/sub/subController.go index 42a33ee6..ec574d6e 100644 --- a/sub/subController.go +++ b/sub/subController.go @@ -87,7 +87,20 @@ func (a *SUBController) subs(c *gin.Context) { if !a.jsonEnabled { subJsonURL = "" } - page := a.subService.BuildPageData(subId, hostHeader, traffic, lastOnline, subs, subURL, subJsonURL) + // Get base_path from context (set by middleware) + basePath, exists := c.Get("base_path") + if !exists { + basePath = "/" + } + // Add subId to base_path for asset URLs + basePathStr := basePath.(string) + if basePathStr == "/" { + basePathStr = "/" + subId + "/" + } else { + // Remove trailing slash if exists, add subId, then add trailing slash + basePathStr = strings.TrimRight(basePathStr, "/") + "/" + subId + "/" + } + page := a.subService.BuildPageData(subId, hostHeader, traffic, lastOnline, subs, subURL, subJsonURL, basePathStr) c.HTML(200, "subpage.html", gin.H{ "title": "subscription.title", "cur_ver": config.GetVersion(), -- cgit v1.2.3