ExZipProtect.Plug (ExZipProtect v0.1.1)

View Source

Public entry point for serving pre‑built “zip bombs”.

alias ExZipProtect.Plug, as: Bomb
Bomb.send(conn, :medium)
  • No‑op if the library is disabled (enabled?: false in config).
  • Bypass if the request carries the user‑defined bypass_header.
  • Otherwise looks up the bomb spec for the given level, sets the required response headers, streams the payload, and halts the connection pipeline.

Summary

Functions

Sends a bomb for level (:low | :medium | :high | …) and halts the Plug pipeline. Optional extra_headers are merged into the response.

Functions

send(conn, level, extra_headers \\ [])

@spec send(Plug.Conn.t(), atom(), keyword()) :: Plug.Conn.t()

Sends a bomb for level (:low | :medium | :high | …) and halts the Plug pipeline. Optional extra_headers are merged into the response.