Enforce a non-negative content length

This commit is contained in:
Andrew Gaul 2013-08-14 17:05:20 -07:00 committed by Andrew Phillips
parent 1a003ee731
commit d387a25113
1 changed files with 1 additions and 0 deletions

View File

@ -178,6 +178,7 @@ public class BlobBuilderImpl implements BlobBuilder {
@Override
public PayloadBlobBuilder contentLength(long contentLength) {
checkArgument(contentLength >= 0, "content length must be non-negative");
payload.getContentMetadata().setContentLength(contentLength);
return this;
}