diff --git a/errors.html.tmpl b/errors.html.tmpl index 566ee4d..8a3a10a 100644 --- a/errors.html.tmpl +++ b/errors.html.tmpl @@ -12,6 +12,6 @@ {{ if eq .Code 404 }}

404 Not Found

{{ else }}

500 Unknown Error

{{ end }}
-
Gitea Pages/{{ .UUID }}
+
Gitea Pages({{.Request.Host}})/{{ .UUID }}
\ No newline at end of file diff --git a/pkg/utils/template.go b/pkg/utils/template.go index 95690fa..4a05a90 100644 --- a/pkg/utils/template.go +++ b/pkg/utils/template.go @@ -13,16 +13,15 @@ func NewTemplateInject(r *http.Request, def map[string]any) map[string]any { def = make(map[string]any) } headers := make(map[string]string) - for k, vs := range r.Header { + for k, vs := range r.Header.Clone() { headers[k] = strings.Join(vs, ",") } def["Request"] = map[string]any{ - "Headers": headers, - "Path": r.URL.Path, - "Method": r.Method, - "RequestURI": r.RequestURI, - "RemoteAddr": r.RemoteAddr, - "RemoteIP": GetRemoteIP(r), + "Host": r.Host, + "Path": r.URL.Path, + "Params": r.URL.Query(), + "Method": r.Method, + "RemoteIP": GetRemoteIP(r), } return def }