aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Limux <66315042+rhabichl@users.noreply.github.com> 2024-04-29 21:37:39 +0200
committerGravatar GitHub <noreply@github.com> 2024-04-29 21:37:39 +0200
commit091733b08e451dd5af97b7cf2625c2d61b549f63 (patch)
treef5012f246d88b37eb0e1a0cd8a8225768461f49b
parentAdd perIPTLSConn to support MaxConnsPerIP with tls connections (diff)
downloadfasthttp-091733b08e451dd5af97b7cf2625c2d61b549f63.tar.gz
fasthttp-091733b08e451dd5af97b7cf2625c2d61b549f63.tar.bz2
fasthttp-091733b08e451dd5af97b7cf2625c2d61b549f63.zip
Implemented what was described by me in #1766. (#1767)
* Implemented what was described by me in issue#1766. * fixed linting isssues in fs.go with gofmt -e -d -s --------- Co-authored-by: Raphael Habichler <raphael.habichler@bmd.at>
-rw-r--r--fs.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs.go b/fs.go
index 59638ad..9e15a0e 100644
--- a/fs.go
+++ b/fs.go
@@ -1233,6 +1233,12 @@ func (h *fsHandler) openIndexFile(ctx *RequestCtx, dirPath string, mustCompress
if err == nil {
return ff, nil
}
+ if mustCompress && err == errNoCreatePermission {
+ ctx.Logger().Printf("insufficient permissions for saving compressed file for %q. Serving uncompressed file. "+
+ "Allow write access to the directory with this file in order to improve fasthttp performance", indexFilePath)
+ mustCompress = false
+ return h.openFSFile(indexFilePath, mustCompress, fileEncoding)
+ }
if !errors.Is(err, fs.ErrNotExist) {
return nil, fmt.Errorf("cannot open file %q: %w", indexFilePath, err)
}