mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-16 18:55:50 +08:00
fix(weixin): trust international WeChat hosts
This commit is contained in:
parent
50d55090b9
commit
dc66366ac0
6 changed files with 14 additions and 5 deletions
|
|
@ -652,7 +652,12 @@ test('Weixin URL, inbound text, and reply chunk helpers enforce their narrow for
|
|||
normalizeWeixinApiBaseUrl('https://ilinkai.weixin.qq.com/path'),
|
||||
'https://ilinkai.weixin.qq.com/path/',
|
||||
);
|
||||
assert.equal(
|
||||
normalizeWeixinApiBaseUrl('https://ilinkai.wechat.com/path'),
|
||||
'https://ilinkai.wechat.com/path/',
|
||||
);
|
||||
assert.throws(() => normalizeWeixinApiBaseUrl('https://ilinkai.weixin.qq.com:444/'));
|
||||
assert.throws(() => normalizeWeixinApiBaseUrl('https://ilinkai.wechat.com.attacker.test/'));
|
||||
assert.equal(extractWeixinText({ item_list: [{ type: 1, text_item: { text: ' 你好 ' } }] }), '你好');
|
||||
assert.equal(extractWeixinText({ item_list: [{ type: 3, voice_item: { text: '语音转写' } }] }), '语音转写');
|
||||
assert.deepEqual(splitWeixinText('abcdefgh', 5), ['abcde', 'fgh']);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue