-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
1 parent
d55d50b
commit e3324aa
Showing
2 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
caddytest/integration/caddyfile_adapt/handle_path_sorting.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |