shouldAddBody method

bool shouldAddBody(
  1. int contentLength
)

Implementation

bool shouldAddBody(int contentLength) {
  if (this == MaxResponseBodySize.never) {
    return false; // Never add body regardless of size
  }
  final limit = getSizeLimit();
  if (limit == null) {
    return true; // No limit means always allow
  }
  return contentLength <= limit;
}