Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 13, 09:15 UTC
Clarify some docs
Matthew Holt committed
Nov 30, 2022 at 16:03 UTC
ae77a56ac8761bfe064904bd7098a952d3221034
2 files changed
+19
-4
modules/caddyhttp/matchers.go
+15
@@ -123,6 +123,7 @@ type (
123
// keyed by the query keys, with an array of string values to match for that key.
124
// Query key matches are exact, but wildcards may be used for value matches. Both
125
// keys and values may be placeholders.
126
+ //
127
// An example of the structure to match `?key=value&topic=api&query=something` is:
128
//
129
// ```json
@@ -135,6 +136,13 @@ type (
136
//
137
// Invalid query strings, including those with bad escapings or illegal characters
138
// like semicolons, will fail to parse and thus fail to match.
139
+ //
140
+ // **NOTE:** Notice that query string values are arrays, not singular values. This is
141
+ // because repeated keys are valid in query strings, and each one may have a
142
+ // different value. This matcher will match for a key if any one of its configured
143
+ // values is assigned in the query string. Backend applications relyon on query
144
+ // strings MUST take into consideration that query string values are arrays and can
145
+ // have multiple values.
146
MatchQuery url.Values
147
148
// MatchHeader matches requests by header fields. The key is the field
@@ -144,6 +152,13 @@ type (
152
// surrounding the value with the wildcard `*` character, respectively.
153
// If a list is null, the header must not exist. If the list is empty,
154
// the field must simply exist, regardless of its value.
155
+ //
156
+ // **NOTE:** Notice that header values are arrays, not singular values. This is
157
+ // because repeated fields are valid in headers, and each one may have a
158
+ // different value. This matcher will match for a field if any one of its configured
159
+ // values matches in the header. Backend applications relying on headers MUST take
160
+ // into consideration that header field values are arrays and can have multiple
161
+ // values.
162
MatchHeader http.Header
163
164
// MatchHeaderRE matches requests by a regular expression on header fields.
modules/caddyhttp/reverseproxy/healthchecks.go
+4
-4
@@ -46,10 +46,10 @@ type HealthChecks struct {
46
47
// Passive health checks monitor proxied requests for errors or timeouts.
48
// To minimally enable passive health checks, specify at least an empty
49
- // config object. Passive health check state is shared (stored globally),
50
- // so a failure from one handler will be counted by all handlers; but
51
- // the tolerances or standards for what defines healthy/unhealthy backends
52
- // is configured per-proxy-handler.
49
+ // config object with fail_duration > 0. Passive health check state is
50
+ // shared (stored globally), so a failure from one handler will be counted
51
+ // by all handlers; but the tolerances or standards for what defines
52
+ // healthy/unhealthy backends is configured per-proxy-handler.
53
//
54
// Passive health checks technically do operate on dynamic upstreams,
55
// but are only effective for very busy proxies where the list of