summaryrefslogtreecommitdiffhomepage
path: root/caddytest
diff options
context:
space:
mode:
authorFrancis Lavoie <[email protected]>2020-09-16 22:01:22 -0400
committerGitHub <[email protected]>2020-09-16 20:01:22 -0600
commite3324aa6de6c6f8f9fc14757025bb15de4801dde (patch)
tree9640edc2de5489eac325472fc2f805f2c28522e0 /caddytest
parentd55d50b3b3a9a8e842bb25e1ee8468587cd346f4 (diff)
downloadcaddy-e3324aa6de6c6f8f9fc14757025bb15de4801dde.tar.gz
caddy-e3324aa6de6c6f8f9fc14757025bb15de4801dde.zip
httpcaddyfile: Ensure handle_path is sorted equally to handle (#3676)
* httpcaddyfile: Ensure handle_path is sorted as equal to handle * httpcaddyfile: Make mutual exclusivity grouping deterministic (I hope) * httpcaddyfile: Add comment linking to the issue being fixed * httpcaddyfile: Typo fix, comment clarity Co-authored-by: Matt Holt <[email protected]> * Update caddyconfig/httpcaddyfile/httptype.go Co-authored-by: Matt Holt <[email protected]>
Diffstat (limited to 'caddytest')
-rw-r--r--caddytest/integration/caddyfile_adapt/handle_path_sorting.txt105
1 files changed, 105 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt/handle_path_sorting.txt b/caddytest/integration/caddyfile_adapt/handle_path_sorting.txt
new file mode 100644
index 000000000..3258dc9b2
--- /dev/null
+++ b/caddytest/integration/caddyfile_adapt/handle_path_sorting.txt
@@ -0,0 +1,105 @@
+:80 {
+ handle /api/* {
+ respond "api"
+ }
+
+ handle_path /static/* {
+ respond "static"
+ }
+
+ handle {
+ respond "handle"
+ }
+}
+----------
+{
+ "apps": {
+ "http": {
+ "servers": {
+ "srv0": {
+ "listen": [
+ ":80"
+ ],
+ "routes": [
+ {
+ "group": "group3",
+ "match": [
+ {
+ "path": [
+ "/static/*"
+ ]
+ }
+ ],
+ "handle": [
+ {
+ "handler": "subroute",
+ "routes": [
+ {
+ "handle": [
+ {
+ "handler": "rewrite",
+ "strip_path_prefix": "/static"
+ }
+ ]
+ },
+ {
+ "handle": [
+ {
+ "body": "static",
+ "handler": "static_response"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "group": "group3",
+ "match": [
+ {
+ "path": [
+ "/api/*"
+ ]
+ }
+ ],
+ "handle": [
+ {
+ "handler": "subroute",
+ "routes": [
+ {
+ "handle": [
+ {
+ "body": "api",
+ "handler": "static_response"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "group": "group3",
+ "handle": [
+ {
+ "handler": "subroute",
+ "routes": [
+ {
+ "handle": [
+ {
+ "body": "handle",
+ "handler": "static_response"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+ }
+} \ No newline at end of file