dartIoGzipBodyDecoder function

Stream<List<int>>? dartIoGzipBodyDecoder(
  1. String contentEncoding,
  2. Stream<List<int>> body
)

The dart:io gzip decoder a dart:io transport hands to the smart HTTP processing.

It accepts the gzip content encoding, case-insensitively, and binds the gzip decoder of dart:io to the encoded body. Every other encoding is refused by returning null, which the processing reports as 415.

Implementation

Stream<List<int>>? dartIoGzipBodyDecoder(
  String contentEncoding,
  Stream<List<int>> body,
) {
  if (contentEncoding.toLowerCase() != 'gzip') {
    return null;
  }
  return gzip.decoder.bind(body);
}