Skip to content

Commit 1beac00

Browse files
committed
feat: add content type header
1 parent 8f5fd74 commit 1beac00

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/event/event.emitter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export class EventEmitter {
1818
headers: {
1919
'X-Message-Type': 'event',
2020
'X-Event-Name': event,
21+
'Content-Type': 'application/json',
2122
},
2223
contentType: 'application/json',
2324
priority: 0,

src/rpc/rpc.client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export class RPCClient {
7676
expiration: timeout / 2,
7777
headers: {
7878
"X-Message-Type": "rpc",
79+
'Content-Type': 'application/json',
7980
},
8081
};
8182

src/rpc/rpc.listener.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,15 @@ export class RPCListener implements OnModuleInit {
3737
}
3838

3939
const { replyTo, deliveryMode, correlationId, contentType } = raw.properties;
40-
const options = { deliveryMode, correlationId, contentType, headers: {} };
40+
41+
const options = {
42+
deliveryMode,
43+
correlationId,
44+
contentType,
45+
headers: {
46+
'Content-Type': 'application/json',
47+
}
48+
};
4149

4250
await this.rmq.publish('', replyTo, response, options);
4351
}

0 commit comments

Comments
 (0)