Skip to content

Commit

Permalink
Merge pull request #15447 from nullc4t/main
Browse files Browse the repository at this point in the history
FIX #13389
  • Loading branch information
ahrtr authored Mar 10, 2023
2 parents 659c74e + 4dad1ed commit e2a5df5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions server/embed/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,18 @@ func (sctx *serveCtx) registerGateway(opts []grpc.DialOption) (*gw.ServeMux, err
return gwmux, nil
}

type wsProxyZapLogger struct {
*zap.Logger
}

func (w wsProxyZapLogger) Warnln(i ...interface{}) {
w.Warn(fmt.Sprint(i...))
}

func (w wsProxyZapLogger) Debugln(i ...interface{}) {
w.Debug(fmt.Sprint(i...))
}

func (sctx *serveCtx) createMux(gwmux *gw.ServeMux, handler http.Handler) *http.ServeMux {
httpmux := http.NewServeMux()
for path, h := range sctx.userHandlers {
Expand All @@ -316,6 +328,7 @@ func (sctx *serveCtx) createMux(gwmux *gw.ServeMux, handler http.Handler) *http.
},
),
wsproxy.WithMaxRespBodyBufferSize(0x7fffffff),
wsproxy.WithLogger(wsProxyZapLogger{sctx.lg}),
),
)
}
Expand Down

0 comments on commit e2a5df5

Please sign in to comment.