diff --git a/.idea/workspace.xml b/.idea/workspace.xml index e0c67588..4895f09f 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,8 +3,8 @@ - - + + @@ -27,11 +27,11 @@ - + - - + + @@ -39,12 +39,21 @@ - + + + + + + + + + + - - + + @@ -72,8 +81,8 @@ - - + + @@ -117,18 +126,6 @@ - - - - - - - - - - - - @@ -141,7 +138,6 @@ - HttpHeaders.CONTENT_TYPE HttpHeaders.CONTE HttpHeaders HttpStatus.FORBIDDEN @@ -171,6 +167,7 @@ unmofi Map<String, as + redirectTo if (_isClosed && !_useStream) @@ -226,7 +223,6 @@ @@ -678,21 +675,7 @@ - - - - 1517973412941 - - - 1517973884510 - 1517974351104 @@ -1023,16 +1006,24 @@ - - - - - - - @@ -1057,9 +1048,15 @@ + + + + + + - @@ -1122,7 +1119,6 @@ @@ -1155,20 +1152,6 @@ - - - - - - - - - - - - - - @@ -1431,16 +1414,6 @@ - - - - - - - - - - @@ -1462,13 +1435,6 @@ - - - - - - - @@ -1500,16 +1466,47 @@ + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 5833003a..b0005516 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.1.4+9 +* Patch `ResponseContext.redirectTo` to `fold` parameters, instead of +`as`-casting them to `Map`. + # 1.1.4+8 * Finalizers can now write to the response buffer or send headers, because said getter now only returns an unmodifiable Map when using diff --git a/lib/src/core/response_context.dart b/lib/src/core/response_context.dart index d22275f3..66d294eb 100644 --- a/lib/src/core/response_context.dart +++ b/lib/src/core/response_context.dart @@ -205,7 +205,9 @@ abstract class ResponseContext implements StreamSink>, StringSink { /// Renders a view to the response stream, and closes the response. Future render(String view, [Map data]) { if (!isOpen) throw closed(); - return app.viewGenerator(view, new Map.from(renderParams)..addAll(data ?? {})).then((content) { + return app + .viewGenerator(view, new Map.from(renderParams)..addAll(data ?? {})) + .then((content) { write(content); headers['content-type'] = 'text/html'; end(); @@ -265,7 +267,11 @@ abstract class ResponseContext implements StreamSink>, StringSink { Route matched = _findRoute(app); if (matched != null) { - redirect(matched.makeUri(params as Map), code: code); + redirect( + matched.makeUri(params.keys.fold>({}, (out, k) { + return out..[k.toString()] = params[k]; + })), + code: code); return; }