MCPcopy
hub / github.com/caddyserver/caddy / placeholderShorthands

Function placeholderShorthands

caddyconfig/httpcaddyfile/shorthands.go:53–91  ·  view source on GitHub ↗

placeholderShorthands returns a slice of old-new string pairs, where the left of the pair is a placeholder shorthand that may be used in the Caddyfile, and the right is the replacement.

()

Source from the content-addressed store, hash-verified

51// where the left of the pair is a placeholder shorthand that may
52// be used in the Caddyfile, and the right is the replacement.
53func placeholderShorthands() []string {
54 return []string{
55 "{host}", "{http.request.host}",
56 "{hostport}", "{http.request.hostport}",
57 "{port}", "{http.request.port}",
58 "{orig_method}", "{http.request.orig_method}",
59 "{orig_uri}", "{http.request.orig_uri}",
60 "{orig_path}", "{http.request.orig_uri.path}",
61 "{orig_dir}", "{http.request.orig_uri.path.dir}",
62 "{orig_file}", "{http.request.orig_uri.path.file}",
63 "{orig_query}", "{http.request.orig_uri.query}",
64 "{orig_?query}", "{http.request.orig_uri.prefixed_query}",
65 "{method}", "{http.request.method}",
66 "{uri}", "{http.request.uri}",
67 "{%uri}", "{http.request.uri_escaped}",
68 "{path}", "{http.request.uri.path}",
69 "{%path}", "{http.request.uri.path_escaped}",
70 "{dir}", "{http.request.uri.path.dir}",
71 "{file}", "{http.request.uri.path.file}",
72 "{query}", "{http.request.uri.query}",
73 "{%query}", "{http.request.uri.query_escaped}",
74 "{?query}", "{http.request.uri.prefixed_query}",
75 "{remote}", "{http.request.remote}",
76 "{remote_host}", "{http.request.remote.host}",
77 "{remote_port}", "{http.request.remote.port}",
78 "{scheme}", "{http.request.scheme}",
79 "{uuid}", "{http.request.uuid}",
80 "{tls_cipher}", "{http.request.tls.cipher_suite}",
81 "{tls_version}", "{http.request.tls.version}",
82 "{tls_client_fingerprint}", "{http.request.tls.client.fingerprint}",
83 "{tls_client_issuer}", "{http.request.tls.client.issuer}",
84 "{tls_client_serial}", "{http.request.tls.client.serial}",
85 "{tls_client_subject}", "{http.request.tls.client.subject}",
86 "{tls_client_certificate_pem}", "{http.request.tls.client.certificate_pem}",
87 "{tls_client_certificate_der_base64}", "{http.request.tls.client.certificate_der_base64}",
88 "{upstream_hostport}", "{http.reverse_proxy.upstream.hostport}",
89 "{client_ip}", "{http.vars.client_ip}",
90 }
91}
92
93// ApplyToSegment replaces shorthand placeholder to its full placeholder, understandable by Caddy.
94func (s ShorthandReplacer) ApplyToSegment(segment *caddyfile.Segment) {

Callers 2

NewShorthandReplacerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected