def ce.io.gz

bend-kit-http@0.38.2.0 · http.bend:4187

import bend-kit-http@0.38.2.0/http.bend as Http
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
import bend-kit-zlib@0.5.0.0/zlib.bend as Zlib

4187# One known coding undone: gzip, x-gzip, br, zstd, deflate, or identity.
4188def ce.io.gz(on: Bool, +c: String, b: Bytes.Bytes) -> IO(Maybe<&1, Bytes.Bytes>):
4189  match on:
4190    case True{}:
4191      ce.eff(~Zlib.libz.inflate, b)
4192    case False{}:
4193      ce.io.br(String.eq(c, "br"), c, b)

Uses (9)

Used by (1)