View Source Antikythera.Plug.ContentDecoding (antikythera v0.5.1)
Plug to decompress the request body when the request has Content-Encoding
header.
Currently only gzip
is supported.
Antikythera does not transparently handle compressed request body, as cowboy. Compression can pack very large data into a small body, so automatically decompressing it may lead to running out of memory.
Therefore, this plug can be used only if the request client is trusted (e.g. after authentication).
Usage
Put the following line in your controller module:
plug Antikythera.Plug.ContentDecoding, :decode, []
Summary
Functions
@spec decode(Antikythera.Conn.t(), any()) :: Antikythera.Conn.t()