previewBytes method

String? previewBytes(
  1. List<int> bytes, {
  2. Map<String, String> headers = const <String, String>{},
})

Implementation

String? previewBytes(
  List<int> bytes, {
  Map<String, String> headers = const <String, String>{},
}) {
  if (!captureBodies || bytes.isEmpty) return null;
  final value = utf8
      .decode(bytes, allowMalformed: true)
      .replaceAll('\u0000', '');
  if (!redact) return value;
  return _redactor.body(value, contentType: _redactor.contentType(headers));
}