Skip to content

Commit ee34656

Browse files
authored
fs: fix openIndexFile when dirPath is empty string (#1779)
1 parent f9f213e commit ee34656

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fs.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,11 @@ func ParseByteRange(byteRange []byte, contentLength int) (startPos, endPos int,
12291229

12301230
func (h *fsHandler) openIndexFile(ctx *RequestCtx, dirPath string, mustCompress bool, fileEncoding string) (*fsFile, error) {
12311231
for _, indexName := range h.indexNames {
1232-
indexFilePath := dirPath + "/" + indexName
1232+
indexFilePath := indexName
1233+
if dirPath != "" {
1234+
indexFilePath = dirPath + "/" + indexName
1235+
}
1236+
12331237
ff, err := h.openFSFile(indexFilePath, mustCompress, fileEncoding)
12341238
if err == nil {
12351239
return ff, nil

0 commit comments

Comments
 (0)