Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

Commit

Permalink
Allow longer name and body proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
bonustrack committed Aug 15, 2020
1 parent ac2d8c8 commit f0086cb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions server/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,18 @@ router.post('/message', async (req, res) => {
if (msg.type === 'proposal') {
if (
Object.keys(msg.payload).length !== 6 ||
!msg.payload.name ||
msg.payload.name.length > 128 ||
!msg.payload.body ||
msg.payload.body.length > 5120 ||
!msg.payload.choices ||
msg.payload.choices.length < 2 ||
!msg.payload.snapshot
) return sendError(res, 'wrong proposal format');

if (
!msg.payload.name ||
msg.payload.name.length > 256 ||
!msg.payload.body ||
msg.payload.body.length > 10240
) return sendError(res, 'wrong proposal size');

if (
!msg.payload.start ||
// ts > msg.payload.start ||
Expand Down

0 comments on commit f0086cb

Please sign in to comment.