剔除更多的模板变量
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user