From 6763a4e27138ce63da7bfccb409d79ce67cb8f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E9=9C=B2?= <1285823170@qq.com> Date: Thu, 25 Apr 2024 17:53:26 +0800 Subject: [PATCH] fix panic when server push request has request headers. (#739) --- common/remote/rpc/rpc_request/rpc_request.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/remote/rpc/rpc_request/rpc_request.go b/common/remote/rpc/rpc_request/rpc_request.go index 041bba11..c1146c61 100644 --- a/common/remote/rpc/rpc_request/rpc_request.go +++ b/common/remote/rpc/rpc_request/rpc_request.go @@ -39,6 +39,9 @@ type IConfigRequest interface { } func (r *Request) PutAllHeaders(headers map[string]string) { + if r.Headers == nil { + r.Headers = make(map[string]string) + } for k, v := range headers { r.Headers[k] = v }