Skip to content

Commit ee0452b

Browse files
committed
update docstring
1 parent 3d3d612 commit ee0452b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pkgs/shelf_router/lib/src/router.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,17 +197,18 @@ class Router {
197197
Future<Response> _invokeMountedHandler(
198198
Request request, Function handler, List<String> pathParams) async {
199199
final paramsMap = request.params;
200-
final effectivePath = _replaceParamsInPath(request.url.path, paramsMap);
200+
final effectivePath = _getEffectiveMountPath(request.url.path, paramsMap);
201201

202202
return await Function.apply(handler, [
203203
request.change(path: effectivePath),
204204
...pathParams.map((param) => paramsMap[param]),
205205
]) as Response;
206206
}
207207

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(
211212
String urlPath,
212213
Map<String, String> paramsMap,
213214
) {

0 commit comments

Comments
 (0)