Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 14, 05:15 UTC
caddyhttp: Fix incorrect determination of gRPC protocol (#4236)
hmol233 committed
Jul 7, 2021 at 00:09 UTC
42e140b1b2f5fc3f602151947dc981334b338020
1 file changed
+1
-1
modules/caddyhttp/matchers.go
+1
-1
@@ -667,7 +667,7 @@ func (MatchProtocol) CaddyModule() caddy.ModuleInfo {
667
func (m MatchProtocol) Match(r *http.Request) bool {
668
switch string(m) {
669
case "grpc":
670
- return r.Header.Get("content-type") == "application/grpc"
670
+ return strings.HasPrefix(r.Header.Get("content-type"), "application/grpc")
671
case "https":
672
return r.TLS != nil
673
case "http":