DecompressConfig defines the config for Decompress middleware.
| 14 | |
| 15 | // DecompressConfig defines the config for Decompress middleware. |
| 16 | type 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. |
| 32 | const GZIPEncoding string = "gzip" |
nothing calls this directly
no outgoing calls
no test coverage detected