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 {
32
32
await this . server . getServerImpl ( ) . registerPubSubSubscriptionRoute ( pubsubName , topic , route ) ;
33
33
34
34
this . server . getServer ( ) . post ( `/${ route } ` , async ( req , res ) => {
35
- // Process our callback
36
35
// @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 ) ;
38
43
39
44
// Let Dapr know that the message was processed correctly
40
45
// console.log(`[Dapr API][PubSub][route-${topic}] Ack'ing the message`);
You can’t perform that action at this time.
0 commit comments