Skip to content

Commit

Permalink
fix: support directory listings even if a 404 page is present
Browse files Browse the repository at this point in the history
fixes ipfs#4233 (comment)

Basically, there's a trade-off here:

1. We can support directory listings while supporting 404 pages (this PR).
2. If a 404 page is present, directory listings don't work.

Given that option 1 is more flexible and users shouldn't be _too_ confused if
they land on a directory with no index.html page, I've gone with that option.
  • Loading branch information
Stebalien authored and Walter Beegle committed Jun 6, 2020
1 parent 1375211 commit edf7606
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions core/corehttp/gateway_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,6 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request
return
}

if i.servePretty404IfPresent(w, r, parsedPath) {
return
}

// storage for directory listing
var dirListing []directoryItem
dirit := dir.Entries()
Expand Down

0 comments on commit edf7606

Please sign in to comment.