File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,15 @@ func (r *Router) OmitRouteFromContext(value bool) *Router {
286
286
return r
287
287
}
288
288
289
+ // OmitRouterFromContext defines the behavior of omitting the Router from the
290
+ // http.Request context.
291
+ //
292
+ // RouterFromRequest will yield nil with this option.
293
+ func (r * Router ) OmitRouterFromContext (value bool ) * Router {
294
+ r .omitRouterFromContext = value
295
+ return r
296
+ }
297
+
289
298
// UseEncodedPath tells the router to match the encoded original path
290
299
// to the routes.
291
300
// For eg. "/path/foo%2Fbar/to" will match the path "/path/{var}/to".
Original file line number Diff line number Diff line change @@ -1768,6 +1768,10 @@ func TestPanicOnCapturingGroups(t *testing.T) {
1768
1768
NewRouter ().NewRoute ().Path ("/{type:(promo|special)}/{promoId}.json" )
1769
1769
}
1770
1770
1771
+ func TestRouterInContext (t * testing.T ) {
1772
+ // TODO Write tests for router in context
1773
+ }
1774
+
1771
1775
// ----------------------------------------------------------------------------
1772
1776
// Helpers
1773
1777
// ----------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments