File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
pkgs/shelf_router/lib/src Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -197,17 +197,18 @@ class Router {
197
197
Future <Response > _invokeMountedHandler (
198
198
Request request, Function handler, List <String > pathParams) async {
199
199
final paramsMap = request.params;
200
- final effectivePath = _replaceParamsInPath (request.url.path, paramsMap);
200
+ final effectivePath = _getEffectiveMountPath (request.url.path, paramsMap);
201
201
202
202
return await Function .apply (handler, [
203
203
request.change (path: effectivePath),
204
204
...pathParams.map ((param) => paramsMap[param]),
205
205
]) as Response ;
206
206
}
207
207
208
- /// Replaces the variable slots (<someVar>) from [path] with the
209
- /// values from [paramsMap]
210
- String _replaceParamsInPath (
208
+ /// Removes the "rest path" from the requested url in mounted routes. This
209
+ /// new path is then used to update the scope of the mounted handler with
210
+ /// [Request.change]
211
+ String _getEffectiveMountPath (
211
212
String urlPath,
212
213
Map <String , String > paramsMap,
213
214
) {
You can’t perform that action at this time.
0 commit comments