From ea7d61d281e4daea9d6b3d060d01b1264862113d Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Wed, 22 Mar 2023 17:25:30 +0800 Subject: [PATCH] rpc custom header --- pkg/common/mw/gin.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/common/mw/gin.go b/pkg/common/mw/gin.go index 3ac61fef1..05c3bf6b1 100644 --- a/pkg/common/mw/gin.go +++ b/pkg/common/mw/gin.go @@ -3,6 +3,7 @@ package mw import ( "bytes" "encoding/json" + "errors" "github.com/OpenIMSDK/Open-IM-Server/pkg/apiresp" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant" @@ -90,8 +91,9 @@ func GinParseOperationID() gin.HandlerFunc { return } if req.OperationID == "" { - log.ZWarn(c, "header must have operationID", errs.ErrArgs.Wrap(err.Error())) - apiresp.GinError(c, errs.ErrArgs.Wrap("header must have operationID"+err.Error())) + err := errors.New("header must have operationID") + log.ZWarn(c, "header must have operationID", err) + apiresp.GinError(c, errs.ErrArgs.Wrap(err.Error())) c.Abort() return }