Documentation
¶
Overview ¶
Package coding undoes HTTP content codings, the values of a Content-Encoding header (RFC 9110, section 8.4.1).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnsupported means the content coding is not identity or gzip. ErrUnsupported = errors.New("unsupported content coding") // ErrHeader means a gzip body does not start with a valid gzip header. ErrHeader = errors.New("invalid gzip header") // ErrTooLarge means the decoded body is over the limit. ErrTooLarge = errors.New("decoded body exceeds the limit") )
Functions ¶
func Decode ¶
Decode undoes the content coding enc, matched without regard to case. It returns nil and no error when data is empty, or when enc is empty or identity, so the caller keeps data as it is. Only gzip is decoded. A decoded body over limit bytes returns ErrTooLarge, and gzip data that breaks off returns the compress/gzip error.
Types ¶
This section is empty.