From 0bcd02d5f669869b0c79c00ea3c5a3f6a7072b20 Mon Sep 17 00:00:00 2001 From: Matt Holt Date: Wed, 15 Jun 2022 09:57:43 -0600 Subject: headers: Support wildcards for delete ops (close #4830) (#4831) --- modules/caddyhttp/headers/headers_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'modules/caddyhttp/headers/headers_test.go') 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 @@ -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{ -- cgit v1.2.3