${requestMethod}变量增加默认值GET

This commit is contained in:
刘祥超
2024-04-22 21:32:53 +08:00
parent d3a4f14999
commit b66c70de66

View File

@@ -825,6 +825,9 @@ func (this *HTTPRequest) Format(source string) string {
case "requestTime":
return fmt.Sprintf("%.6f", this.requestCost)
case "requestMethod":
if len(this.RawReq.Method) == 0 {
return http.MethodGet
}
return this.RawReq.Method
case "requestFilename":
filename := this.requestFilename()