Validation of header in authreq should be done only in the key (#5053)
This commit is contained in:
parent
fc41dc732a
commit
77586dd83b
2 changed files with 4 additions and 4 deletions
|
@ -218,8 +218,8 @@ func (a authReq) Parse(ing *networking.Ingress) (interface{}, error) {
|
|||
return nil, ing_errors.NewLocationDenied(fmt.Sprintf("unable to find configMap %q", proxySetHeaderMap))
|
||||
}
|
||||
|
||||
for header, value := range proxySetHeadersMapContents.Data {
|
||||
if !ValidHeader(header) || !ValidHeader(value) {
|
||||
for header := range proxySetHeadersMapContents.Data {
|
||||
if !ValidHeader(header) {
|
||||
return nil, ing_errors.NewLocationDenied("invalid proxy-set-headers in configmap")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -276,8 +276,8 @@ func TestProxySetHeaders(t *testing.T) {
|
|||
}{
|
||||
{"single header", "http://goog.url", map[string]string{"header": "h1"}, false},
|
||||
{"no header map", "http://goog.url", nil, true},
|
||||
{"header with spaces", "http://goog.url", map[string]string{"header": "bad value"}, true},
|
||||
{"header with other bad symbols", "http://goog.url", map[string]string{"header": "bad+value"}, true},
|
||||
{"header with spaces", "http://goog.url", map[string]string{"header": "bad value"}, false},
|
||||
{"header with other bad symbols", "http://goog.url", map[string]string{"header": "bad+value"}, false},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
|
Loading…
Reference in a new issue