shouldAddBody method

bool shouldAddBody(
  1. int contentLength
)

Implementation

bool shouldAddBody(int contentLength) {
  switch (this) {
    case MaxRequestBodySize.never:
      break;
    case MaxRequestBodySize.small:
      return contentLength <= _smallSize;
    case MaxRequestBodySize.medium:
      return contentLength <= _mediumSize;
    case MaxRequestBodySize.always:
      return true;
    // No default here to get a warning when a new enum value is added.
  }
  return false;
}