Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Check for max shard size #547

Merged
merged 3 commits into from
Jan 10, 2018
Merged

Conversation

braydonf
Copy link
Contributor

@braydonf braydonf commented Dec 7, 2017

Prevent possible DoS

Requires: storj-archived/service-storage-models#144

Closes: storj-archived/storjshare-daemon#307

Todo:

  • Update package.json with released storage models

Prevent possible DoS
@littleskunk
Copy link
Collaborator

As third party developer I would like to read the current shard size limit as part of the error message. That would be a very good feedback and I don't need to read any FAQ.

@@ -244,6 +246,10 @@ FramesRouter.prototype.addShardToFrame = function(req, res, next) {
));
}

if (req.body.size > MAX_SHARD_SIZE) {
return next(new errors.BadRequestError('Maximum shard size'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to return next(new errors.BadRequestError('Shard of size ' + req.body.size + ' is larger than maximum shard size: ' + MAX_SHARD_SIZE));

@aleitner aleitner merged commit c9ea777 into storj-archived:master Jan 10, 2018
@braydonf braydonf deleted the max-shard-size branch January 10, 2018 18:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants