summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/headers/headers_test.go
diff options
context:
space:
mode:
authorMatt Holt <mholt@users.noreply.github.com>2022-06-15 09:57:43 -0600
committerGitHub <noreply@github.com>2022-06-15 09:57:43 -0600
commit0bcd02d5f669869b0c79c00ea3c5a3f6a7072b20 (patch)
tree066b0f5accb2f7ab0a1097d42e23f0e2e6b81545 /modules/caddyhttp/headers/headers_test.go
parentc82fe91104efbbe62826510579ea57fd54c55f8c (diff)
headers: Support wildcards for delete ops (close #4830) (#4831)
Diffstat (limited to 'modules/caddyhttp/headers/headers_test.go')
-rw-r--r--modules/caddyhttp/headers/headers_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/caddyhttp/headers/headers_test.go b/modules/caddyhttp/headers/headers_test.go
index fb68225..d74e6fc 100644
--- a/modules/caddyhttp/headers/headers_test.go
+++ b/modules/caddyhttp/headers/headers_test.go
@@ -82,6 +82,26 @@ func TestHandler(t *testing.T) {
{
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{
Replace: map[string][]Replacement{
"Best-Server": {
Replacement{