From 42e140b1b2f5fc3f602151947dc981334b338020 Mon Sep 17 00:00:00 2001 From: hmol233 <82594500+hmol233@users.noreply.github.com> Date: Wed, 7 Jul 2021 00:09:44 +0800 Subject: caddyhttp: Fix incorrect determination of gRPC protocol (#4236) --- modules/caddyhttp/matchers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/caddyhttp/matchers.go') 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": -- cgit v1.2.3