setContentLengthRange method

void setContentLengthRange(
  1. int min,
  2. int max
)

set minimum/maximum length of what Content-Length can be.

Implementation

void setContentLengthRange(int min, int max) {
  if (min > max) {
    throw MinioError('min cannot be more than max');
  }
  if (min < 0) {
    throw MinioError('min should be > 0');
  }
  if (max < 0) {
    throw MinioError('max should be > 0');
  }
  policy['conditions'].push(['content-length-range', min, max]);
}