Skip to content

Commit

Permalink
Revert openIndexFile manually
Browse files Browse the repository at this point in the history
  • Loading branch information
mojatter committed Jul 8, 2022
1 parent 3dd25f3 commit 89043cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs.go
Expand Up @@ -876,7 +876,7 @@ func (h *fsHandler) handleRequest(ctx *RequestCtx) {
ctx.RedirectBytes(append(path, '/'), StatusFound)
return
}
ff, err = h.openIndexFile(ctx, pathStr, filePath, mustCompress, fileEncoding)
ff, err = h.openIndexFile(ctx, filePath, mustCompress, fileEncoding)
if err != nil {
ctx.Logger().Printf("cannot open dir index %q: %v", filePath, err)
ctx.Error("Directory index is forbidden", StatusForbidden)
Expand Down Expand Up @@ -1042,7 +1042,7 @@ func ParseByteRange(byteRange []byte, contentLength int) (startPos, endPos int,
return startPos, endPos, nil
}

func (h *fsHandler) openIndexFile(ctx *RequestCtx, path, dirPath string, mustCompress bool, fileEncoding string) (*fsFile, error) {
func (h *fsHandler) openIndexFile(ctx *RequestCtx, dirPath string, mustCompress bool, fileEncoding string) (*fsFile, error) {
for _, indexName := range h.indexNames {
indexFilePath := filepath.Join(dirPath, indexName)
ff, err := h.openFSFile(indexFilePath, mustCompress, fileEncoding)
Expand Down

0 comments on commit 89043cd

Please sign in to comment.