summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/matchers.go
diff options
context:
space:
mode:
authorhmol233 <82594500+hmol233@users.noreply.github.com>2021-07-07 00:09:44 +0800
committerGitHub <noreply@github.com>2021-07-06 12:09:44 -0400
commit42e140b1b2f5fc3f602151947dc981334b338020 (patch)
treea34e842e4febe97e1749f4e0c89534badfcb2f8b /modules/caddyhttp/matchers.go
parent4245ceb67d1a40ce7a691bcf85e143218e5c458c (diff)
caddyhttp: Fix incorrect determination of gRPC protocol (#4236)
Diffstat (limited to 'modules/caddyhttp/matchers.go')
-rw-r--r--modules/caddyhttp/matchers.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/caddyhttp/matchers.go b/modules/caddyhttp/matchers.go
index 9b127db..1a49b3c 100644
--- a/modules/caddyhttp/matchers.go
+++ b/modules/caddyhttp/matchers.go
@@ -667,7 +667,7 @@ func (MatchProtocol) CaddyModule() caddy.ModuleInfo {
func (m MatchProtocol) Match(r *http.Request) bool {
switch string(m) {
case "grpc":
- return r.Header.Get("content-type") == "application/grpc"
+ return strings.HasPrefix(r.Header.Get("content-type"), "application/grpc")
case "https":
return r.TLS != nil
case "http":