Skip to content

Client-side and server-side validation of test file upload #17

Description

@quasimik

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersmvpFeature is critical for release

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions