Server validation errors should return appropriate error codes.
Referring to this, probably the only relevant ones are:
400 Bad Request when fields are missing or malformed
413 Payload Too Large when fields are too large (including files)
For 413 Payload Too Large, maybe multer already somehow takes care of it (needs testing):
|
limits: { |
|
// fieldNameSize: asdf, |
|
fieldSize: TEST_FILE_UPLOAD_MAX_SIZE, |
|
// fields: asdf, |
|
fileSize: TEST_FILE_UPLOAD_MAX_SIZE, |
|
// files: asdf, |
|
// parts: asdf, |
|
// headerPairs: asdf, |
|
} |
Remember that authorization is already handled by the verifyToken middleware, so we shouldn't have to bother with a 403 Forbidden here.
Server validation errors should return appropriate error codes.
Referring to this, probably the only relevant ones are:
400 Bad Requestwhen fields are missing or malformed413 Payload Too Largewhen fields are too large (including files)For
413 Payload Too Large, maybemulteralready somehow takes care of it (needs testing):UPE-Website-V2/backend/server.js
Lines 72 to 80 in 124c092
Remember that authorization is already handled by the verifyToken middleware, so we shouldn't have to bother with a
403 Forbiddenhere.