diff options
author | Limux <66315042+rhabichl@users.noreply.github.com> | 2024-04-29 21:37:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-29 21:37:39 +0200 |
commit | 091733b08e451dd5af97b7cf2625c2d61b549f63 (patch) | |
tree | f5012f246d88b37eb0e1a0cd8a8225768461f49b | |
parent | Add perIPTLSConn to support MaxConnsPerIP with tls connections (diff) | |
download | fasthttp-091733b08e451dd5af97b7cf2625c2d61b549f63.tar.gz fasthttp-091733b08e451dd5af97b7cf2625c2d61b549f63.tar.bz2 fasthttp-091733b08e451dd5af97b7cf2625c2d61b549f63.zip |
* 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.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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) } |