From acf7dea68fe6ace110221faa26c2503a1ea432ce Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Mon, 14 Oct 2019 12:09:43 -0600 Subject: caddyhttp: host labels placeholders endianness from right->left https://caddy.community/t/labeln-placeholder-endian-issue/5366 (I thought we had this before but it must have gotten lost somewhere) --- modules/caddyhttp/replacer_test.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'modules/caddyhttp/replacer_test.go') diff --git a/modules/caddyhttp/replacer_test.go b/modules/caddyhttp/replacer_test.go index d10c74f..b355c7f 100644 --- a/modules/caddyhttp/replacer_test.go +++ b/modules/caddyhttp/replacer_test.go @@ -34,8 +34,8 @@ func TestHTTPVarReplacement(t *testing.T) { addHTTPVarsToReplacer(repl, req, res) for i, tc := range []struct { - input string - expect string + input string + expect string }{ { input: "{http.request.scheme}", @@ -61,6 +61,14 @@ func TestHTTPVarReplacement(t *testing.T) { input: "{http.request.remote.port}", expect: "1234", }, + { + input: "{http.request.host.labels.0}", + expect: "com", + }, + { + input: "{http.request.host.labels.1}", + expect: "example", + }, } { actual := repl.ReplaceAll(tc.input, "") if actual != tc.expect { -- cgit v1.2.3