-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit the size of the sending file #376
Conversation
Changes Unknown when pulling 389af62 on mukaiu:limit_file_size into ** on Chatie:master**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are very efficient, thanks!
src/puppet-web/puppet-web.ts
Outdated
@@ -353,6 +353,10 @@ export class PuppetWeb extends Puppet { | |||
})) | |||
}) | |||
|
|||
let fileMaxSize = 20 * 1024 * 1024 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Should be const instead of let.
- Could you link to the size limit code line in wxwebapp(we have a track tool named webwxapp-tracker
)? So we could track it in the future.
src/puppet-web/puppet-web.ts
Outdated
@@ -353,6 +353,10 @@ export class PuppetWeb extends Puppet { | |||
})) | |||
}) | |||
|
|||
let fileMaxSize = 20 * 1024 * 1024 | |||
if (buffer.length > fileMaxSize) | |||
throw new Error('Maximum file size 20M') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
20M should be calculated here instead of hard coded.
Changes Unknown when pulling 0f74cbe on mukaiu:limit_file_size into ** on Chatie:master**. |
1 similar comment
Changes Unknown when pulling 0f74cbe on mukaiu:limit_file_size into ** on Chatie:master**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
src/puppet-web/puppet-web.ts
Outdated
@@ -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/master/formatted/webwxApp.js#L1115 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the link with a specific commit hash number instead of the latest, because what we want to track is a specific version.
src/puppet-web/puppet-web.ts
Outdated
// https://github.com/Chatie/webwx-app-tracker/blob/master/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 20MB') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw new Error('Sending video files is not allowed to exceed ' + videoMaxSize/1024/1024 + 'MB')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using
`Sending video files is not allowed to exceed ${videoMaxSize/1024/1024}MB`
My code details need to be optimized😄😄😄 |
Great, thanks! |
* fix Upcase * use .alias() instead of .remark() contact.remark() should be deprecated * fix Upcase * use .alias() instead of .remark() contact.remark() should be deprecated * fix the embeded doc for .alias() * fix trailing whitespace * 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 * fix Upcase * use .alias() instead of .remark() contact.remark() should be deprecated * fix the embeded doc for .alias() * fix trailing whitespace * remove unnecessary comments in the exmaple code * better example code * Set / Get / Delete => SET / GET /DELETE * better delete alias example * Revert "Limit the size of the sending file (#376)" This reverts commit a59984e.
Wechat web limits the file size to 20M