Refactored StaticFS()

- different approach to disable directory listing.
This commit is contained in:
Manu Mtz-Almeida
2015-05-24 16:29:55 +02:00
parent 0a9030f9d7
commit fcfe65685a
3 changed files with 43 additions and 13 deletions
+1 -2
View File
@@ -179,7 +179,7 @@ func TestRouteStaticFile(t *testing.T) {
// TestHandleStaticDir - ensure the root/sub dir handles properly
func TestRouteStaticListingDir(t *testing.T) {
router := New()
router.StaticFS("/", http.Dir("./"), true)
router.StaticFS("/", Dir("./", true))
w := performRequest(router, "GET", "/")
@@ -195,7 +195,6 @@ func TestRouteStaticNoListing(t *testing.T) {
w := performRequest(router, "GET", "/")
assert.Equal(t, w.Code, 404)
assert.NotContains(t, w.Body.String(), "gin.go")
}