| 791 | } |
| 792 | |
| 793 | func Test_Router_NotFound(t *testing.T) { |
| 794 | t.Parallel() |
| 795 | app := New() |
| 796 | app.Use(func(c Ctx) error { |
| 797 | return c.Next() |
| 798 | }) |
| 799 | appHandler := app.Handler() |
| 800 | c := &fasthttp.RequestCtx{} |
| 801 | |
| 802 | c.Request.Header.SetMethod("DELETE") |
| 803 | c.URI().SetPath("/this/route/does/not/exist") |
| 804 | |
| 805 | appHandler(c) |
| 806 | |
| 807 | require.Equal(t, 404, c.Response.StatusCode()) |
| 808 | require.Equal(t, "Not Found", string(c.Response.Body())) |
| 809 | } |
| 810 | |
| 811 | func Test_Router_NotFound_HTML_Inject(t *testing.T) { |
| 812 | t.Parallel() |