Skip to content

Commit 61184d1

Browse files
committed
fix: fix a problem which make disableMsgpack not work
1 parent 22656c6 commit 61184d1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

server/mixins/socketio.mixin.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ interface TcSocketIOServiceOptions {
5959
* 用户token校验
6060
*/
6161
userAuth: (token: string) => Promise<UserJWTPayload>;
62+
63+
/**
64+
* 是否禁用msgpack
65+
*/
66+
disableMsgpack?: boolean;
6267
}
6368

6469
/**
@@ -541,7 +546,7 @@ export const TcSocketIOService = (
541546
origin: '*',
542547
methods: ['GET', 'POST'],
543548
},
544-
parser: msgpackParser,
549+
parser: options.disableMsgpack ? undefined : msgpackParser,
545550
});
546551

547552
if (

server/services/core/gateway.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export default class ApiService extends TcService {
4242

4343
return user;
4444
},
45+
disableMsgpack: config.feature.disableMsgpack,
4546
})
4647
);
4748
this.registerMixin(TcHealth());

0 commit comments

Comments
 (0)