Skip to content

Commit

Permalink
fs: fix openIndexFile when dirPath is empty string (#1779)
Browse files Browse the repository at this point in the history
  • Loading branch information
efectn committed May 19, 2024
1 parent f9f213e commit ee34656
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ee34656

Please sign in to comment.