Skip to content

Input validation is required to avoid 500 errors #506

@Robin-Van-de-Merghel

Description

@Robin-Van-de-Merghel

In every endpoint where we handle numbers, we must verify that the input is less than a certain (fixed) maximum.

Sometimes, the db raises 500 errors for multiple reasons:

  • In the job query for example pymysql.err.ProgrammingError, setting $\text{page number }>100$
  • In a PR I'm doing for Pilots where I insert an int in the db, I have a pymysql.err.DataError) (1264, "Out of range value for column ...")

I did not check every endpoint, but we should have for every type that we input in an endpoint and that will be used in the DB, something to check if it's valid or not.

This should be the same for strings, because we set in the schema a maximum length.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions