mirror of
https://github.com/halverneus/static-file-server.git
synced 2024-11-24 09:05:30 +00:00
Merge pull request #4 from lb-saildrone/master
fixing small logic issue
This commit is contained in:
commit
571765d935
2
serve.go
2
serve.go
@ -176,7 +176,7 @@ func main() {
|
||||
// will attempt to retrieve the index file of that directory.
|
||||
func handleListing(show bool, serve http.HandlerFunc) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
if show || strings.HasSuffix(r.URL.Path, "/") {
|
||||
if !show && strings.HasSuffix(r.URL.Path, "/") {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user