-
Notifications
You must be signed in to change notification settings - Fork 108
Open
Description
cve-services/src/middleware/middleware.js
Line 12 in cd41522
const errors = require('./error') |
cve-services/src/middleware/middleware.js
Lines 355 to 360 in cd41522
function validateJsonSyntax (err, req, res, next) { | |
if (err.status && err.message) { | |
if (err.message.includes('request entity too large')) { | |
console.warn('Request failed validation because entity too large') | |
console.info((JSON.stringify(err))) | |
return res.status(413).json(error.recordTooLarge(errors)) |
validateJsonSyntax, unlike validateCveJsonSchema, does not have a local variable named errors
. Thus, it is apparently not useful to have errors
as the argument to error.recordTooLarge, especially because this is:
cve-services/src/middleware/error.js
Lines 106 to 112 in cd41522
recordTooLarge () { // mw | |
const err = {} | |
err.error = 'RECORD_TOO_LARGE' | |
err.message = 'Records must be less than 3.8MB.' | |
return err | |
} | |
} |
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Needs Triage