MCPcopy
hub / github.com/valyala/fasthttp / ServeFileUncompressed

Function ServeFileUncompressed

fs.go:58–61  ·  view source on GitHub ↗

ServeFileUncompressed returns HTTP response containing file contents from the given path. Directory contents is returned if path points to directory. ServeFile may be used for saving network traffic when serving files with good compression ratio. See also RequestCtx.SendFile. WARNING: do not pas

(ctx *RequestCtx, path string)

Source from the content-addressed store, hash-verified

56// WARNING: if path is based on user input users will be able to request
57// any file on your filesystem! Use fasthttp.FS with a sane Root instead.
58func ServeFileUncompressed(ctx *RequestCtx, path string) {
59 ctx.Request.Header.DelBytes(strAcceptEncoding)
60 ServeFile(ctx, path)
61}
62
63// ServeFileBytes returns HTTP response containing compressed file contents
64// from the given path.

Callers 3

Calls 2

ServeFileFunction · 0.85
DelBytesMethod · 0.45

Tested by 2

Used in the wild real call sites across dependent graphs

searching dependent graphs…