fix Context.Next() - recheck len of handlers every iteration (#1745)

* fix Context.Next() - recheck len of handlers every iteration

* add tests when Context.reset() can be called inside of handler

TestEngineHandleContext
TestContextResetInHandler
TestRouterStaticFSFileNotFound

* Context.Next() - format to while style
This commit is contained in:
Dmitry Kutakov
2019-01-18 04:57:06 +03:00
committed by thinkerou
parent b056a34bdc
commit 4867ff9634
4 changed files with 41 additions and 1 deletions
+10
View File
@@ -427,6 +427,16 @@ func TestRouterStaticFSNotFound(t *testing.T) {
assert.Equal(t, "non existent", w.Body.String())
}
func TestRouterStaticFSFileNotFound(t *testing.T) {
router := New()
router.StaticFS("/", http.FileSystem(http.Dir(".")))
assert.NotPanics(t, func() {
performRequest(router, "GET", "/nonexistent")
})
}
func TestRouteRawPath(t *testing.T) {
route := New()
route.UseRawPath = true