mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-07 18:50:27 +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 {
|
func (this *HTTPRequest) requestHeader(key string) string {
|
||||||
v, found := this.RawReq.Header[key]
|
v, found := this.RawReq.Header[key]
|
||||||
if !found {
|
if !found {
|
||||||
|
// 转换为canonical header再尝试
|
||||||
|
var canonicalHeaderKey = http.CanonicalHeaderKey(key)
|
||||||
|
if canonicalHeaderKey != key {
|
||||||
|
return strings.Join(this.RawReq.Header[canonicalHeaderKey], ";")
|
||||||
|
}
|
||||||
|
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
return strings.Join(v, ";")
|
return strings.Join(v, ";")
|
||||||
|
|||||||
Reference in New Issue
Block a user