mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-07 02:20:25 +08:00
${header.NAME}变量中的NAME可以时非标准格式
This commit is contained in:
@@ -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, ";")
|
||||
|
||||
Reference in New Issue
Block a user