summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/matchers.go
diff options
context:
space:
mode:
authorScott Mebberson <scott@scottmebberson.com>2021-08-20 14:14:28 +0930
committerGitHub <noreply@github.com>2021-08-19 22:44:28 -0600
commitc1cd192ee760cf4ad4e6ca6021ceb86f03576e1e (patch)
tree09603fedd6497e0dc8d58a15b4c7588248bafffd /modules/caddyhttp/matchers.go
parenta056fcd7ba64b6f313f08ec7a48536c726ca432b (diff)
caddyhttp: Updated the documentation for MatchQuery (#4295)
Diffstat (limited to 'modules/caddyhttp/matchers.go')
-rw-r--r--modules/caddyhttp/matchers.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/modules/caddyhttp/matchers.go b/modules/caddyhttp/matchers.go
index 1a49b3c..b452d48 100644
--- a/modules/caddyhttp/matchers.go
+++ b/modules/caddyhttp/matchers.go
@@ -82,7 +82,19 @@ type (
// MatchMethod matches requests by the method.
MatchMethod []string
- // MatchQuery matches requests by URI's query string.
+ // MatchQuery matches requests by the URI's query string. It takes a JSON object
+ // keyed by the query keys, with an array of string values to match for that key.
+ // Query key matches are exact, but wildcards may be used for value matches. Both
+ // keys and values may be placeholders.
+ // An example of the structure to match `?key=value&topic=api&query=something` is:
+ //
+ // ```json
+ // {
+ // "key": ["value"],
+ // "topic": ["api"],
+ // "query": ["*"]
+ // }
+ // ```
MatchQuery url.Values
// MatchHeader matches requests by header fields. It performs fast,