提交 a59984e7 编写于 作者: M Mukaiu 提交者: Huan (李卓桓)

Limit the size of the sending file (#376)

* Limit the size of the sending file

* limit vedio size

* add remark

* tslint

* Optimize videoMaxSize limit

* tslint
上级 d0df7a8d
...@@ -353,6 +353,12 @@ export class PuppetWeb extends Puppet { ...@@ -353,6 +353,12 @@ export class PuppetWeb extends Puppet {
})) }))
}) })
// Sending video files is not allowed to exceed 20MB
// https://github.com/Chatie/webwx-app-tracker/blob/7c59d35c6ea0cff38426a4c5c912a086c4c512b2/formatted/webwxApp.js#L1115
const videoMaxSize = 20 * 1024 * 1024
if (mediatype === 'video' && buffer.length > videoMaxSize)
throw new Error(`Sending video files is not allowed to exceed ${videoMaxSize / 1024 / 1024}MB`)
let md5 = UtilLib.md5(buffer) let md5 = UtilLib.md5(buffer)
let baseRequest = await this.getBaseRequest() let baseRequest = await this.getBaseRequest()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册