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 <[email protected]>
  • Loading branch information
hacdias and lidel authored Aug 15, 2023
1 parent 5de8f5f commit 50fcc4e
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 50fcc4e

Please sign in to comment.