${header.NAME}变量中的NAME可以时非标准格式

This commit is contained in:
GoEdgeLab
2023-05-19 17:50:39 +08:00
parent 9f5bc87d0f
commit 4f3423bf42

View File

@@ -1288,6 +1288,12 @@ func (this *HTTPRequest) requestQueryParam(name string) string {
func (this *HTTPRequest) requestHeader(key string) string {
v, found := this.RawReq.Header[key]
if !found {
// 转换为canonical header再尝试
var canonicalHeaderKey = http.CanonicalHeaderKey(key)
if canonicalHeaderKey != key {
return strings.Join(this.RawReq.Header[canonicalHeaderKey], ";")
}
return ""
}
return strings.Join(v, ";")