File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,11 @@ nextDirective:
4545 It basically terminates location block matching.
4646 https://www.keycdn.com/support/nginx-location-directive
4747 */
48- matchConfMap ["path" ] = caddyhttp .MatchPath ([]string {dir .Param (2 ) + "*" })
48+ p := dir .Param (2 )
49+ if ! strings .HasSuffix (p , "*" ) {
50+ p += "*"
51+ }
52+ matchConfMap ["path" ] = caddyhttp .MatchPath ([]string {p })
4953 warns = append (warns , caddyconfig.Warning {
5054 File : dir .File ,
5155 Line : dir .Line ,
@@ -64,7 +68,11 @@ nextDirective:
6468 continue nextDirective
6569 }
6670 // append wild character because nginx treat naked path matchers as prefix matchers
67- matchConfMap ["path" ] = caddyhttp .MatchPath ([]string {dir .Param (1 ) + "*" })
71+ p := dir .Param (1 )
72+ if ! strings .HasSuffix (p , "*" ) {
73+ p += "*"
74+ }
75+ matchConfMap ["path" ] = caddyhttp .MatchPath ([]string {p })
6876 }
6977 subsubroutes , warns , err := ss .locationContext (matchConfMap , dir .Block )
7078 if err != nil || len (subsubroutes ) == 0 {
You can’t perform that action at this time.
0 commit comments