fix: callback post reqeust lack of operation header

pull/1783/head
luhaoling 2 years ago
parent 4dc2313bbc
commit 3202e8dff3

@ -221,6 +221,7 @@ func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.Unive
statisticsGroup.POST("/group/create", g.GroupCreateCount)
statisticsGroup.POST("/group/active", m.GetActiveGroup)
}
callback := r.Group("/callbackExample")
{
callback.POST("/callbackBeforeSendSingleMsgCommand", m.CallbackExample)

@ -112,7 +112,9 @@ func callBackPostReturn(ctx context.Context, url, command string, input interfac
//v.Set(constant.CallbackCommand, command)
//url = url + "/" + v.Encode()
url = url + "/" + command
b, err := Post(ctx, url, nil, input, callbackConfig.CallbackTimeOut)
header := map[string]string{}
header["operationID"] = ctx.Value(constant.OperationID).(string)
b, err := Post(ctx, url, header, input, callbackConfig.CallbackTimeOut)
if err != nil {
if callbackConfig.CallbackFailedContinue != nil && *callbackConfig.CallbackFailedContinue {
log.ZWarn(ctx, "callback failed but continue", err, "url", url)

Loading…
Cancel
Save