File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/implementation/Server/HTTPServer Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -32,9 +32,14 @@ export default class HTTPServerPubSub implements IServerPubSub {
3232 await this . server . getServerImpl ( ) . registerPubSubSubscriptionRoute ( pubsubName , topic , route ) ;
3333
3434 this . server . getServer ( ) . post ( `/${ route } ` , async ( req , res ) => {
35- // Process our callback
3635 // @ts -ignore
37- await cb ( req ?. body ?. data ) ;
36+ // Parse the data of the body, we prioritize fetching the data key in body if possible
37+ // i.e. Redis returns { data: {} } and other services return {}
38+ // @todo : This will be deprecated in an upcoming major version and only req.body will be returned
39+ const data = req ?. body ?. data || req ?. body ;
40+
41+ // Process our callback
42+ await cb ( data ) ;
3843
3944 // Let Dapr know that the message was processed correctly
4045 // console.log(`[Dapr API][PubSub][route-${topic}] Ack'ing the message`);
You can’t perform that action at this time.
0 commit comments