Skip to content

Commit

Permalink
chore: apply feedback suggestion
Browse files Browse the repository at this point in the history
Co-authored-by: Marcin Rataj <lidel@lidel.org>
  • Loading branch information
hacdias and lidel committed Aug 15, 2023
1 parent 0ebd5d3 commit 34b4055
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gateway/handler_unixfs_dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ func (i *handler) serveDirectory(ctx context.Context, w http.ResponseWriter, r *
// Check if directory has index.html, if so, serveFile
appendIndexHtml := func(p ipath.Path) ipath.Path {
basePath := p.String()
if basePath[len(basePath)-1] == '/' {
return ipath.New(basePath + "index.html")
if basePath[len(basePath)-1] != '/' {
basePath += "/"
}
return ipath.New(basePath + "/index.html")
return ipath.New(basePath + "index.html")
}

idxPath := appendIndexHtml(contentPath)
Expand Down

0 comments on commit 34b4055

Please sign in to comment.