From e7c59adc5928d9d9ef96480297f7618e3d57837c Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Wed, 22 May 2024 17:51:55 +0200 Subject: Ensure IPv6 compliant host Co-Authored-By: vnxme <46669194+vnxme@users.noreply.github.com> --- web/controller/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/controller') diff --git a/web/controller/util.go b/web/controller/util.go index a32c9270..ac08f9af 100644 --- a/web/controller/util.go +++ b/web/controller/util.go @@ -61,7 +61,7 @@ func html(c *gin.Context, name string, title string, data gin.H) { data = gin.H{} } data["title"] = title - data["host"] = strings.Split(c.Request.Host, ":")[0] + data["host"], _, _ = net.SplitHostPort(c.Request.Host) data["request_uri"] = c.Request.RequestURI data["base_path"] = c.GetString("base_path") c.HTML(http.StatusOK, name, getContext(data)) -- cgit v1.2.3