shouldAddBody method

bool shouldAddBody(
  1. int contentLength
)

Implementation

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