Documentation
¶
Overview ¶
Package codec — body.go: HTTP response-body decompression helpers shared by control (display decoding) and intruder (grep decoding).
Package codec provides the small, pure encode/decode transforms behind the Decoder tool and the MCP `decode` tool: base64, URL, hex, HTML entities, and JWT inspection, plus a best-effort "smart" auto-decode.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Ops = []string{
"base64encode", "base64decode",
"urlencode", "urldecode",
"hexencode", "hexdecode",
"htmlencode", "htmldecode",
"jwtdecode", "smart",
}
Ops lists every supported operation id (also the order shown in the UI).
Functions ¶
func DecompressBody ¶ added in v0.12.0
DecompressBody inflates body according to the Content-Encoding header value. It supports gzip, deflate, br (brotli), and zstd. On success it returns the decompressed bytes and true. On any failure (unknown encoding, corrupt data, empty result) it returns nil, false — callers must fall back to the raw body.
For a comma-separated encoding chain the outermost (last) encoding is applied, which is the common case for HTTP/1.1 responses.
func IsBinaryContentType ¶ added in v0.12.0
IsBinaryContentType returns true when the Content-Type header value indicates binary content (image, audio, video, font, octet-stream, zip, wasm, pdf) that cannot be meaningfully grepped as text.
Types ¶
This section is empty.