def ce.io.gz

bend-kit-http@0.38.5.0 · http.bend:4191

import bend-kit-http@0.38.5.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.1.0/zlib.bend as Zlib

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

Uses (9)

Used by (1)