Skip to content

Commit d3c305c

Browse files
authored
fix: add workaround to fix 'stream terminated by RST_STREAM with error code: PROTOCOL_ERROR' (argoproj#1862)
Signed-off-by: Alexander Matyushentsev <[email protected]>
1 parent 459112b commit d3c305c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

server/server.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"net"
99
"net/http"
1010
"os"
11+
"strings"
1112
"time"
1213

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

102103
gwMuxOpts := runtime.WithMarshalerOption(runtime.MIMEWildcard, new(json.JSONMarshaler))
103104
gwmux := runtime.NewServeMux(gwMuxOpts,
104-
runtime.WithIncomingHeaderMatcher(func(key string) (string, bool) { return key, true }),
105+
runtime.WithIncomingHeaderMatcher(func(key string) (string, bool) {
106+
// Dropping "Connection" header as a workaround for https://github.com/grpc-ecosystem/grpc-gateway/issues/2447
107+
// 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
108+
return key, strings.ToLower(key) != "connection"
109+
}),
105110
runtime.WithProtoErrorHandler(runtime.DefaultHTTPProtoErrorHandler),
106111
)
107112

0 commit comments

Comments
 (0)