Skip to content

Commit

Permalink
fix: add workaround to fix 'stream terminated by RST_STREAM with erro…
Browse files Browse the repository at this point in the history
…r code: PROTOCOL_ERROR' (#1862)

Signed-off-by: Alexander Matyushentsev <[email protected]>
  • Loading branch information
alexmt authored Feb 12, 2022
1 parent 459112b commit d3c305c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net"
"net/http"
"os"
"strings"
"time"

"github.com/argoproj/pkg/errors"
Expand Down Expand Up @@ -101,7 +102,11 @@ func (s *ArgoRolloutsServer) newHTTPServer(ctx context.Context, port int) *http.

gwMuxOpts := runtime.WithMarshalerOption(runtime.MIMEWildcard, new(json.JSONMarshaler))
gwmux := runtime.NewServeMux(gwMuxOpts,
runtime.WithIncomingHeaderMatcher(func(key string) (string, bool) { return key, true }),
runtime.WithIncomingHeaderMatcher(func(key string) (string, bool) {
// Dropping "Connection" header as a workaround for https://github.com/grpc-ecosystem/grpc-gateway/issues/2447
// The fix is part of grpc-gateway v2.x but not available in v1.x, so workaround should be removed after upgrading to grpc v2.x
return key, strings.ToLower(key) != "connection"
}),
runtime.WithProtoErrorHandler(runtime.DefaultHTTPProtoErrorHandler),
)

Expand Down

0 comments on commit d3c305c

Please sign in to comment.