Skip to content

Commit

Permalink
fix(api): payload validation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
simme committed Apr 26, 2015
1 parent 6644078 commit 14bae87
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tala.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,12 @@ function startServer() {
parse: true
},
validate: {
// @TODO: Make comment length configurable?
payload: {
username: joi.string().min(1).max(32),
email: joi.string().email(),
comment: joi.string().min(1).max(1024 * 3),
resource: joi.string().min(1),
url: joi.string() // @FIXME: Validate URL
username: joi.string().min(1).max(32).required(),
email: joi.string().email().required(),
comment: joi.string().min(1).max(1024 * 3).required(),
resource: joi.string().min(1).required(),
url: joi.string().uri()
}
}
}
Expand Down

0 comments on commit 14bae87

Please sign in to comment.