|
|
|
@ -445,13 +445,13 @@ func CurrentRoute(r *http.Request) *Route { |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func requestWithVars(r *http.Request, val interface{}) *http.Request { |
|
|
|
func requestWithVars(r *http.Request, vars map[string]string) *http.Request { |
|
|
|
ctx := context.WithValue(r.Context(), varsKey, val) |
|
|
|
ctx := context.WithValue(r.Context(), varsKey, vars) |
|
|
|
return r.WithContext(ctx) |
|
|
|
return r.WithContext(ctx) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func requestWithRoute(r *http.Request, val interface{}) *http.Request { |
|
|
|
func requestWithRoute(r *http.Request, route *Route) *http.Request { |
|
|
|
ctx := context.WithValue(r.Context(), routeKey, val) |
|
|
|
ctx := context.WithValue(r.Context(), routeKey, route) |
|
|
|
return r.WithContext(ctx) |
|
|
|
return r.WithContext(ctx) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|