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

This commit is contained in:
GoEdgeLab
2024-04-22 21:32:53 +08:00
parent c86fe81392
commit 1f9f3d64e5

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()