rfc3261_18_3_response function

bool rfc3261_18_3_response()

Implementation

bool rfc3261_18_3_response() {
  int len = Utils.strUtf8Length(message.body!);
  // ignore: always_specify_types
  var contentLength = message.getHeader('content-length');

  if (contentLength != null && contentLength is String) {
    contentLength = int.tryParse(contentLength) ?? 0;
  } else {
    contentLength = 0;
  }

  if (len < contentLength) {
    logger.debug(
        'message body length is lower than the value in Content-Length header field, dropping the response');

    return false;
  }

  return true;
}