From 93f0dae1eb338963e3fe5959a8451f543d81f19e Mon Sep 17 00:00:00 2001 From: Tobe O Date: Mon, 9 Jul 2018 11:24:39 -0400 Subject: [PATCH] * Apply `fold` in `redirectToAction`; bump version -> 1.1.4+9 --- CHANGELOG.md | 1 + lib/src/core/response_context.dart | 4 +++- pubspec.yaml | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0005516..c8f6c679 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # 1.1.4+9 * Patch `ResponseContext.redirectTo` to `fold` parameters, instead of `as`-casting them to `Map`. +* Apply this same folding to `ResponseContext.redirectToAction`. # 1.1.4+8 * Finalizers can now write to the response buffer or send headers, diff --git a/lib/src/core/response_context.dart b/lib/src/core/response_context.dart index 66d294eb..19132f7a 100644 --- a/lib/src/core/response_context.dart +++ b/lib/src/core/response_context.dart @@ -303,7 +303,9 @@ abstract class ResponseContext implements StreamSink>, StringSink { final head = controller.findExpose().path.toString().replaceAll(_straySlashes, ''); final tail = matched - .makeUri(params as Map) + .makeUri(params.keys.fold>({}, (out, k) { + return out..[k.toString()] = params[k]; + })) .replaceAll(_straySlashes, ''); redirect('$head/$tail'.replaceAll(_straySlashes, ''), code: code); diff --git a/pubspec.yaml b/pubspec.yaml index 9d806e86..7c6af27c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_framework -version: 1.1.4+8 +version: 1.1.4+9 description: A high-powered HTTP server with DI, routing and more. author: Tobe O homepage: https://github.com/angel-dart/angel_framework