headers: Support wildcards for delete ops (close #4830) (#4831)

This commit is contained in:
Matt Holt
2022-06-15 09:57:43 -06:00
committed by GitHub
parent c82fe91104
commit 0bcd02d5f6
2 changed files with 51 additions and 3 deletions

View File

@ -79,6 +79,26 @@ func TestHandler(t *testing.T) {
"Keep-Me": []string{"i swear i'm innocent"},
},
},
{
handler: Handler{
Request: &HeaderOps{
Delete: []string{
"*-suffix",
"prefix-*",
"*_*",
},
},
},
reqHeader: http.Header{
"Header-Suffix": []string{"lalala"},
"Prefix-Test": []string{"asdf"},
"Host_Header": []string{"silly django... sigh"}, // see issue #4830
"Keep-Me": []string{"foofoofoo"},
},
expectedReqHeader: http.Header{
"Keep-Me": []string{"foofoofoo"},
},
},
{
handler: Handler{
Request: &HeaderOps{