mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-20 22:52:58 -05:00
caddyhttp: Fix incorrect determination of gRPC protocol (#4236)
This commit is contained in:
parent
4245ceb67d
commit
42e140b1b2
1 changed files with 1 additions and 1 deletions
|
@ -667,7 +667,7 @@ func (MatchProtocol) CaddyModule() caddy.ModuleInfo {
|
||||||
func (m MatchProtocol) Match(r *http.Request) bool {
|
func (m MatchProtocol) Match(r *http.Request) bool {
|
||||||
switch string(m) {
|
switch string(m) {
|
||||||
case "grpc":
|
case "grpc":
|
||||||
return r.Header.Get("content-type") == "application/grpc"
|
return strings.HasPrefix(r.Header.Get("content-type"), "application/grpc")
|
||||||
case "https":
|
case "https":
|
||||||
return r.TLS != nil
|
return r.TLS != nil
|
||||||
case "http":
|
case "http":
|
||||||
|
|
Loading…
Add table
Reference in a new issue