From 2cc5d2227dd8b8ad2d71112709ec29ab34fcd0ea Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Fri, 14 Feb 2020 11:00:46 -0700 Subject: [PATCH] Minor tweaks to docs/comments --- modules/caddyhttp/matchers.go | 7 ++++++- modules/caddyhttp/server.go | 17 +++++++---------- modules/caddytls/certselection.go | 4 ++-- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/modules/caddyhttp/matchers.go b/modules/caddyhttp/matchers.go index 552aa913d..3b890d9da 100644 --- a/modules/caddyhttp/matchers.go +++ b/modules/caddyhttp/matchers.go @@ -72,7 +72,12 @@ type ( // MatchQuery matches requests by URI's query string. MatchQuery url.Values - // MatchHeader matches requests by header fields. + // MatchHeader matches requests by header fields. It performs fast, + // exact string comparisons of the field values. Fast prefix, suffix, + // and substring matches can also be done by suffixing, prefixing, or + // surrounding the value with the wildcard `*` character, respectively. + // If a list is null, the header must not exist. If the list is empty, + // the field must simply exist, regardless of its value. MatchHeader http.Header // MatchHeaderRE matches requests by a regular expression on header fields. diff --git a/modules/caddyhttp/server.go b/modules/caddyhttp/server.go index 1c896a441..124331de1 100644 --- a/modules/caddyhttp/server.go +++ b/modules/caddyhttp/server.go @@ -324,16 +324,13 @@ type HTTPErrorConfig struct { // chain returns an error. In an error route, extra // placeholders are available: // - // {http.error.status_code} - // The recommended HTTP status code - // {http.error.status_text} - // The status text associated with the recommended status code - // {http.error.message} - // The error message - // {http.error.trace} - // The origin of the error - // {http.error.id} - // A short, human-conveyable ID for the error + // Placeholder | Description + // ------------|--------------- + // `{http.error.status_code}` | The recommended HTTP status code + // `{http.error.status_text}` | The status text associated with the recommended status code + // `{http.error.message}` | The error message + // `{http.error.trace}` | The origin of the error + // `{http.error.id}` | An identifier for this occurrence of the error Routes RouteList `json:"routes,omitempty"` } diff --git a/modules/caddytls/certselection.go b/modules/caddytls/certselection.go index 10a3ee5df..0d49eb777 100644 --- a/modules/caddytls/certselection.go +++ b/modules/caddytls/certselection.go @@ -14,8 +14,8 @@ func init() { caddy.RegisterModule(CustomCertSelectionPolicy{}) } -// CertSelectionPolicy represents a policy for selecting the certificate used -// to complete a handshake when there may be multiple options. All fields +// CustomCertSelectionPolicy represents a policy for selecting the certificate +// used to complete a handshake when there may be multiple options. All fields // specified must match the candidate certificate for it to be chosen. // This was needed to solve https://github.com/caddyserver/caddy/issues/2588. type CustomCertSelectionPolicy struct {