File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -158,13 +158,15 @@ func New() *Router {
158
158
// Group returns a new grouped Router.
159
159
// Path auto-correction, including trailing slashes, is enabled by default.
160
160
func (r * Router ) Group (path string ) * Router {
161
- return & Router {
161
+ g := & Router {
162
162
beginPath : path ,
163
163
RedirectTrailingSlash : true ,
164
164
RedirectFixedPath : true ,
165
165
HandleMethodNotAllowed : true ,
166
166
HandleOPTIONS : true ,
167
167
}
168
+ r .NotFound = g .Handler
169
+ return g
168
170
}
169
171
170
172
// GET is a shortcut for router.Handle("GET", path, handle)
Original file line number Diff line number Diff line change @@ -312,7 +312,6 @@ func TestRouterChaining(t *testing.T) {
312
312
func TestRouterGroup (t * testing.T ) {
313
313
r1 := New ()
314
314
r2 := r1 .Group ("/boo" )
315
- r1 .NotFound = r2 .Handler
316
315
fooHit := false
317
316
r1 .POST ("/foo" , func (ctx * fasthttp.RequestCtx ) {
318
317
fooHit = true
You can’t perform that action at this time.
0 commit comments