mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-25 17:45:28 +03:00
fs: fix openIndexFile when dirPath is empty string (#1779)
This commit is contained in:
@@ -1229,7 +1229,11 @@ func ParseByteRange(byteRange []byte, contentLength int) (startPos, endPos int,
|
||||
|
||||
func (h *fsHandler) openIndexFile(ctx *RequestCtx, dirPath string, mustCompress bool, fileEncoding string) (*fsFile, error) {
|
||||
for _, indexName := range h.indexNames {
|
||||
indexFilePath := dirPath + "/" + indexName
|
||||
indexFilePath := indexName
|
||||
if dirPath != "" {
|
||||
indexFilePath = dirPath + "/" + indexName
|
||||
}
|
||||
|
||||
ff, err := h.openFSFile(indexFilePath, mustCompress, fileEncoding)
|
||||
if err == nil {
|
||||
return ff, nil
|
||||
|
||||
Reference in New Issue
Block a user