增加referer.host请求变量

This commit is contained in:
GoEdgeLab
2021-07-26 15:37:47 +08:00
parent bb86523837
commit 19e03abf0b

View File

@@ -570,6 +570,12 @@ func (this *HTTPRequest) Format(source string) string {
return this.Host
case "referer":
return this.RawReq.Referer()
case "referer.host":
u, err := url.Parse(this.RawReq.Referer())
if err == nil {
return u.Host
}
return ""
case "userAgent":
return this.RawReq.UserAgent()
case "contentType":