From 138e4b49bf402b72f69e958f5962877f5973ff77 Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Wed, 20 May 2015 11:30:22 +0200 Subject: [PATCH] Using WrapH() internally. --- routergroup.go | 4 +--- utils_test.go | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/routergroup.go b/routergroup.go index 4ded0d6..816d74a 100644 --- a/routergroup.go +++ b/routergroup.go @@ -123,9 +123,7 @@ func (group *RouterGroup) StaticFS(relativePath string, fs http.FileSystem) { func (group *RouterGroup) createStaticHandler(relativePath string, fs http.FileSystem) func(*Context) { absolutePath := group.calculateAbsolutePath(relativePath) fileServer := http.StripPrefix(absolutePath, http.FileServer(fs)) - return func(c *Context) { - fileServer.ServeHTTP(c.Writer, c.Request) - } + return WrapH(fileServer) } func (group *RouterGroup) combineHandlers(handlers HandlersChain) HandlersChain { diff --git a/utils_test.go b/utils_test.go index 19fab5d..ba0cc20 100644 --- a/utils_test.go +++ b/utils_test.go @@ -46,10 +46,6 @@ func TestWrap(t *testing.T) { assert.Equal(t, w.Body.String(), "hola!") } -func TestWrapH(t *testing.T) { - -} - func TestLastChar(t *testing.T) { assert.Equal(t, lastChar("hola"), uint8('a')) assert.Equal(t, lastChar("adios"), uint8('s'))