summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/matchers.go
diff options
context:
space:
mode:
authorMatt Holt <mholt@users.noreply.github.com>2022-09-05 13:50:44 -0600
committerGitHub <noreply@github.com>2022-09-05 13:50:44 -0600
commitca4fae64d99a63291a91e59af5a1e8eef8c8e2d8 (patch)
tree45ceb6051ca12027b8b323ac59ca5833a0f0a6ce /modules/caddyhttp/matchers.go
parentad69503aefeead7782022e8e8698c16b1e6c638d (diff)
caddyhttp: Support `respond` with HTTP 103 Early Hints (#5006)
* caddyhttp: Support sending HTTP 103 Early Hints This adds support for early hints in the static_response handler. * caddyhttp: Don't record 1xx responses
Diffstat (limited to 'modules/caddyhttp/matchers.go')
-rw-r--r--modules/caddyhttp/matchers.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/caddyhttp/matchers.go b/modules/caddyhttp/matchers.go
index 5056c9a..f86ce0a 100644
--- a/modules/caddyhttp/matchers.go
+++ b/modules/caddyhttp/matchers.go
@@ -1121,6 +1121,22 @@ func (m MatchProtocol) Match(r *http.Request) bool {
return r.TLS != nil
case "http":
return r.TLS == nil
+ case "http/1.0":
+ return r.ProtoMajor == 1 && r.ProtoMinor == 0
+ case "http/1.0+":
+ return r.ProtoAtLeast(1, 0)
+ case "http/1.1":
+ return r.ProtoMajor == 1 && r.ProtoMinor == 1
+ case "http/1.1+":
+ return r.ProtoAtLeast(1, 1)
+ case "http/2":
+ return r.ProtoMajor == 2
+ case "http/2+":
+ return r.ProtoAtLeast(2, 0)
+ case "http/3":
+ return r.ProtoMajor == 3
+ case "http/3+":
+ return r.ProtoAtLeast(3, 0)
}
return false
}