summaryrefslogtreecommitdiff
path: root/caddytest/integration/caddyfile_adapt
diff options
context:
space:
mode:
Diffstat (limited to 'caddytest/integration/caddyfile_adapt')
-rw-r--r--caddytest/integration/caddyfile_adapt/matcher_syntax.txt59
1 files changed, 59 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt/matcher_syntax.txt b/caddytest/integration/caddyfile_adapt/matcher_syntax.txt
index 8cabc58..53ec023 100644
--- a/caddytest/integration/caddyfile_adapt/matcher_syntax.txt
+++ b/caddytest/integration/caddyfile_adapt/matcher_syntax.txt
@@ -9,6 +9,15 @@
@matcher3 not method PUT
respond @matcher3 "not put"
+
+ @matcher4 vars "{http.request.uri}" "/vars-matcher"
+ respond @matcher4 "from vars matcher"
+
+ @matcher5 vars_regexp static "{http.request.uri}" `\.([a-f0-9]{6})\.(css|js)$`
+ respond @matcher5 "from vars_regexp matcher with name"
+
+ @matcher6 vars_regexp "{http.request.uri}" `\.([a-f0-9]{6})\.(css|js)$`
+ respond @matcher6 "from vars_regexp matcher without name"
}
----------
{
@@ -68,6 +77,56 @@
"handler": "static_response"
}
]
+ },
+ {
+ "match": [
+ {
+ "vars": {
+ "{http.request.uri}": "/vars-matcher"
+ }
+ }
+ ],
+ "handle": [
+ {
+ "body": "from vars matcher",
+ "handler": "static_response"
+ }
+ ]
+ },
+ {
+ "match": [
+ {
+ "vars_regexp": {
+ "{http.request.uri}": {
+ "name": "static",
+ "pattern": "\\.([a-f0-9]{6})\\.(css|js)$"
+ }
+ }
+ }
+ ],
+ "handle": [
+ {
+ "body": "from vars_regexp matcher with name",
+ "handler": "static_response"
+ }
+ ]
+ },
+ {
+ "match": [
+ {
+ "vars_regexp": {
+ "{http.request.uri}": {
+ "pattern": "\\.([a-f0-9]{6})\\.(css|js)$"
+ }
+ }
+ }
+ ],
+ "handle": [
+ {
+ "body": "from vars_regexp matcher without name",
+ "handler": "static_response"
+ }
+ ]
}
]
}