fs: fix openIndexFile when dirPath is empty string (#1779)

This commit is contained in:
M. Efe Çetin
2024-05-19 16:11:58 +03:00
committed by GitHub
parent f9f213efa6
commit ee34656bec
+5 -1
View File
@@ -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