Skip to content

Commit

Permalink
fix: Allow gRPC connections from gRPC versions >1.17.x (argoproj#6577)
Browse files Browse the repository at this point in the history
* fix: Allow gRPC connections from gRPC versions >1.17.x

Signed-off-by: jannfis <[email protected]>

* Use correct muxer for matching

Signed-off-by: jannfis <[email protected]>
  • Loading branch information
jannfis authored Jun 28, 2021
1 parent f74d807 commit d47f466
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func (a *ArgoCDServer) Run(ctx context.Context, port int, metricsPort int) {
var httpsL net.Listener
if !a.useTLS() {
httpL = tcpm.Match(cmux.HTTP1Fast())
grpcL = tcpm.Match(cmux.HTTP2HeaderField("content-type", "application/grpc"))
grpcL = tcpm.MatchWithWriters(cmux.HTTP2MatchHeaderFieldSendSettings("content-type", "application/grpc"))
} else {
// We first match on HTTP 1.1 methods.
httpL = tcpm.Match(cmux.HTTP1Fast())
Expand All @@ -334,7 +334,7 @@ func (a *ArgoCDServer) Run(ctx context.Context, port int, metricsPort int) {
// Now, we build another mux recursively to match HTTPS and gRPC.
tlsm = cmux.New(tlsl)
httpsL = tlsm.Match(cmux.HTTP1Fast())
grpcL = tlsm.Match(cmux.Any())
grpcL = tlsm.MatchWithWriters(cmux.HTTP2MatchHeaderFieldSendSettings("content-type", "application/grpc"))
}

// Start the muxed listeners for our servers
Expand Down

0 comments on commit d47f466

Please sign in to comment.