Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 14, 05:15 UTC
httpcaddyfile: Add {remote} shorthand placeholders
Also sort the list
Matthew Holt committed
Feb 4, 2020 at 13:31 UTC
c0f827e0bdbd779be5430d76a4eee99fc2153baf
1 file changed
+8
-5
caddyconfig/httpcaddyfile/httptype.go
+8
-5
@@ -94,15 +94,18 @@ func (st ServerType) Setup(originalServerBlocks []caddyfile.ServerBlock,
94
// their actual placeholder identifiers or
95
// variable names
96
replacer := strings.NewReplacer(
97
- "{uri}", "{http.request.uri}",
98
- "{path}", "{http.request.uri.path}",
97
+ "{dir}", "{http.request.uri.path.dir}",
98
+ "{file}", "{http.request.uri.path.file}",
99
"{host}", "{http.request.host}",
100
"{hostport}", "{http.request.hostport}",
101
"{method}", "{http.request.method}",
102
- "{scheme}", "{http.request.scheme}",
103
- "{file}", "{http.request.uri.path.file}",
104
- "{dir}", "{http.request.uri.path.dir}",
102
+ "{path}", "{http.request.uri.path}",
103
"{query}", "{http.request.uri.query}",
104
+ "{remote_host}", "{http.request.remote.host}",
105
+ "{remote_port}", "{http.request.remote.port}",
106
+ "{remote}", "{http.request.remote}",
107
+ "{scheme}", "{http.request.scheme}",
108
+ "{uri}", "{http.request.uri}",
109
)
110
for _, segment := range sb.block.Segments {
111
for i := 0; i < len(segment); i++ {