diff --git a/pkg/rpc/jsons/http_cache_config.md b/pkg/rpc/jsons/http_cache_config.md index 516fe72..631ae1a 100644 --- a/pkg/rpc/jsons/http_cache_config.md +++ b/pkg/rpc/jsons/http_cache_config.md @@ -69,7 +69,7 @@ { "type": "url-extension", "isRequest": true, - "param": "${requestPathExtension}", + "param": "${requestPathLowerExtension}", "operator": "in", "value": "[\".css\",\".png\",\".js\",\".woff2\"]", "isReverse": false, diff --git a/pkg/rpc/jsons/http_cache_ref.md b/pkg/rpc/jsons/http_cache_ref.md index 4ed819b..b742eb4 100644 --- a/pkg/rpc/jsons/http_cache_ref.md +++ b/pkg/rpc/jsons/http_cache_ref.md @@ -71,7 +71,7 @@ { "type": "url-extension", "isRequest": true, - "param": "${requestPathExtension}", + "param": "${requestPathLowerExtension}", "operator": "in", "value": "[\".css\",\".png\",\".js\",\".woff2\"]", "isReverse": false, diff --git a/pkg/serverconfigs/metric_item_utils.go b/pkg/serverconfigs/metric_item_utils.go index 9918321..ca29084 100644 --- a/pkg/serverconfigs/metric_item_utils.go +++ b/pkg/serverconfigs/metric_item_utils.go @@ -86,6 +86,11 @@ func FindAllMetricKeyDefinitions(category MetricItemCategory) []*shared.Definiti Code: "${requestPathExtension}", Description: "请求路径中的文件扩展名,包括点符号,比如.html、.png", }, + { + Name: "小写文件扩展名", + Code: "${requestPathLowerExtension}", + Description: "请求路径中的文件扩展名小写形式,包括点符号,比如.html、.png", + }, { Name: "主机名", Code: "${host}", diff --git a/pkg/serverconfigs/shared/request_variables.go b/pkg/serverconfigs/shared/request_variables.go index 1742707..c5d5fc1 100644 --- a/pkg/serverconfigs/shared/request_variables.go +++ b/pkg/serverconfigs/shared/request_variables.go @@ -18,6 +18,8 @@ func DefaultRequestVariables() []maps.Map { {"code": "${requestLength}", "name": "请求内容长度", "description": ""}, {"code": "${requestMethod}", "name": "请求方法", "description": "比如GET、POST"}, {"code": "${requestFilename}", "name": "请求文件路径", "description": ""}, + {"code": "${requestPathExtension}", "name": "请求文件扩展名", "description": "请求路径中的文件扩展名,包括点符号,比如.html、.png"}, + {"code": "${requestPathLowerExtension}", "name": "请求文件小写扩展名", "description": "请求路径中的文件扩展名,其中大写字母会被自动转换为小写,包括点符号,比如.html、.png"}, {"code": "${scheme}", "name": "请求协议,http或https", "description": ""}, {"code": "${proto}", "name": "包含版本的HTTP请求协议", "description:": "类似于HTTP/1.0"}, {"code": "${timeISO8601}", "name": "ISO 8601格式的时间", "description": "比如2018-07-16T23:52:24.839+08:00"},