MCPcopy
hub / github.com/labstack/echo / DecompressConfig

Struct DecompressConfig

middleware/decompress.go:16–29  ·  view source on GitHub ↗

DecompressConfig defines the config for Decompress middleware.

Source from the content-addressed store, hash-verified

14
15// DecompressConfig defines the config for Decompress middleware.
16type DecompressConfig struct {
17 // Skipper defines a function to skip middleware.
18 Skipper Skipper
19
20 // GzipDecompressPool defines an interface to provide the sync.Pool used to create/store Gzip readers
21 GzipDecompressPool Decompressor
22
23 // MaxDecompressedSize limits the maximum size of decompressed request body in bytes.
24 // If the decompressed body exceeds this limit, the middleware returns HTTP 413 error.
25 // This prevents zip bomb attacks where small compressed payloads decompress to huge sizes.
26 // Default: 100 * MB (104,857,600 bytes)
27 // Set to -1 to disable limits (not recommended in production).
28 MaxDecompressedSize int64
29}
30
31// GZIPEncoding content-encoding header if set to "gzip", decompress body contents.
32const GZIPEncoding string = "gzip"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected