chore: apply the 4mb max limit on drpc protocol message size (#17771)

Respect the 4mb max limit on proto messages
This commit is contained in:
Steven Masley
2025-05-13 11:24:51 -05:00
committed by GitHub
parent a1c03b6c5f
commit 64807e1d61
10 changed files with 121 additions and 10 deletions

View File

@ -31,6 +31,7 @@ import (
"github.com/coder/coder/v2/coderd/telemetry"
"github.com/coder/coder/v2/coderd/util/ptr"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/codersdk/drpcsdk"
"github.com/coder/coder/v2/provisionerd/proto"
"github.com/coder/coder/v2/provisionersdk"
"github.com/coder/websocket"
@ -370,6 +371,7 @@ func (api *API) provisionerDaemonServe(rw http.ResponseWriter, r *http.Request)
return
}
server := drpcserver.NewWithOptions(mux, drpcserver.Options{
Manager: drpcsdk.DefaultDRPCOptions(nil),
Log: func(err error) {
if xerrors.Is(err, io.EOF) {
return