1
0
mirror of https://github.com/gofiber/fiber.git synced 2025-02-22 06:12:55 +00:00

Update ctx.go

Co-Authored-By: RW <renewerner87@googlemail.com>
This commit is contained in:
Fenny 2020-07-03 14:02:00 +02:00
parent b1aeec8c80
commit 2ebadb4c38

2
ctx.go
View File

@ -856,6 +856,8 @@ func (ctx *Ctx) SendFile(file string, compress ...bool) error {
}
sendFileHandler = sendFileFS.NewRequestHandler()
}
// Keep original path for mutable params
ctx.pathOriginal = utils.ImmutableString(ctx.pathOriginal)
// Disable compression
if len(compress) <= 0 || !compress[0] {
// https://github.com/valyala/fasthttp/blob/master/fs.go#L46