Skip to content

Commit b192933

Browse files
author
liguoliang
committed
RpcFilter短路设置
1 parent 5a76e80 commit b192933

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/DotNetCoreRpc.Server/DotNetCoreRpcMiddleware.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ private AspectPiplineBuilder CreatPipleline(RpcContext aspectContext)
102102
Data = rpcContext.ReturnValue,
103103
Code = (int)HttpStatusCode.OK
104104
};
105+
106+
if (rpcContext.ReturnValue is ResponseModel returnValue)
107+
{
108+
responseModel = returnValue;
109+
}
110+
105111
await aspectContext.HttpContext.Response.WriteAsync(responseModel.ToJson());
106112
});
107113

0 commit comments

Comments
 (0)