From a8bb4a665af358f61a7ac0eabac8df2110cb6a36 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Mon, 25 Apr 2022 12:47:12 -0400 Subject: httpcaddyfile: Add `{vars.*}` placeholder shortcut, reverse `vars` sort order (#4726) * httpcaddyfile: Add `{vars.*}` placeholder shortcut I'm yoinking this from my https://github.com/caddyserver/caddy/pull/4657 PR because I think we should get this in ASAP for v2.5.0 along with the new `vars` directive. * Sort vars by matchers in reverse --- .../caddyfile_adapt/sort_vars_in_reverse.txt | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 caddytest/integration/caddyfile_adapt/sort_vars_in_reverse.txt (limited to 'caddytest/integration/caddyfile_adapt') diff --git a/caddytest/integration/caddyfile_adapt/sort_vars_in_reverse.txt b/caddytest/integration/caddyfile_adapt/sort_vars_in_reverse.txt new file mode 100644 index 0000000..dff75e1 --- /dev/null +++ b/caddytest/integration/caddyfile_adapt/sort_vars_in_reverse.txt @@ -0,0 +1,59 @@ +:80 + +vars /foobar foo last +vars /foo foo middle +vars * foo first +---------- +{ + "apps": { + "http": { + "servers": { + "srv0": { + "listen": [ + ":80" + ], + "routes": [ + { + "handle": [ + { + "foo": "first", + "handler": "vars" + } + ] + }, + { + "match": [ + { + "path": [ + "/foo" + ] + } + ], + "handle": [ + { + "foo": "middle", + "handler": "vars" + } + ] + }, + { + "match": [ + { + "path": [ + "/foobar" + ] + } + ], + "handle": [ + { + "foo": "last", + "handler": "vars" + } + ] + } + ] + } + } + } + } +} \ No newline at end of file -- cgit v1.2.3