mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Added static file limit handling in Files API
refs https://github.com/TryGhost/Toolbox/issues/114 - Just like with media files same limits apply and can be configured through the usual limit service's config
This commit is contained in:
parent
be748f2f6d
commit
f0242baf9f
2 changed files with 11 additions and 0 deletions
7
core/server/api/canary/utils/validators/input/files.js
Normal file
7
core/server/api/canary/utils/validators/input/files.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
const limitService = require('../../../../../services/limits');
|
||||
|
||||
module.exports = {
|
||||
async upload(apiConfig, frame) {
|
||||
await limitService.errorIfIsOverLimit('uploads', {currentCount: frame.file.size});
|
||||
}
|
||||
};
|
|
@ -31,6 +31,10 @@ module.exports = {
|
|||
return require('./media');
|
||||
},
|
||||
|
||||
get files() {
|
||||
return require('./files');
|
||||
},
|
||||
|
||||
get settings() {
|
||||
return require('./settings');
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue