View definition

func ServeFileBytes

Defined in


ServeFileBytes returns HTTP response containing compressed file contents from the given path.

HTTP response may contain uncompressed file contents in the following cases:

* Missing 'Accept-Encoding: gzip' request header.
* No write access to directory containing the file.

Directory contents is returned if path points to directory.

Use ServeFileBytesUncompressed is you don't need serving compressed file contents.

See also RequestCtx.SendFileBytes.

ServeFileBytes is referenced in 1 repository