diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-05-22 18:51:55 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-05-22 21:06:49 +0300 |
| commit | e7c59adc5928d9d9ef96480297f7618e3d57837c (patch) | |
| tree | 92c66e8937d1733f3cc629d0420a5298755e27e9 /web/controller/util.go | |
| parent | 68c9b55447a4508341d8947e038de35a3306bbb8 (diff) | |
Ensure IPv6 compliant host
Co-Authored-By: vnxme <46669194+vnxme@users.noreply.github.com>
Diffstat (limited to 'web/controller/util.go')
| -rw-r--r-- | web/controller/util.go | 2 |
1 files changed, 1 insertions, 1 deletions
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)) |
