Using WrapH() internally.
This commit is contained in:
parent
825737a78c
commit
138e4b49bf
@ -123,9 +123,7 @@ func (group *RouterGroup) StaticFS(relativePath string, fs http.FileSystem) {
|
|||||||
func (group *RouterGroup) createStaticHandler(relativePath string, fs http.FileSystem) func(*Context) {
|
func (group *RouterGroup) createStaticHandler(relativePath string, fs http.FileSystem) func(*Context) {
|
||||||
absolutePath := group.calculateAbsolutePath(relativePath)
|
absolutePath := group.calculateAbsolutePath(relativePath)
|
||||||
fileServer := http.StripPrefix(absolutePath, http.FileServer(fs))
|
fileServer := http.StripPrefix(absolutePath, http.FileServer(fs))
|
||||||
return func(c *Context) {
|
return WrapH(fileServer)
|
||||||
fileServer.ServeHTTP(c.Writer, c.Request)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (group *RouterGroup) combineHandlers(handlers HandlersChain) HandlersChain {
|
func (group *RouterGroup) combineHandlers(handlers HandlersChain) HandlersChain {
|
||||||
|
@ -46,10 +46,6 @@ func TestWrap(t *testing.T) {
|
|||||||
assert.Equal(t, w.Body.String(), "hola!")
|
assert.Equal(t, w.Body.String(), "hola!")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestWrapH(t *testing.T) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestLastChar(t *testing.T) {
|
func TestLastChar(t *testing.T) {
|
||||||
assert.Equal(t, lastChar("hola"), uint8('a'))
|
assert.Equal(t, lastChar("hola"), uint8('a'))
|
||||||
assert.Equal(t, lastChar("adios"), uint8('s'))
|
assert.Equal(t, lastChar("adios"), uint8('s'))
|
||||||
|
Loading…
Reference in New Issue
Block a user