diff --git a/CHANGELOG.md b/CHANGELOG.md index b8545e00..98e5ca69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # 2.0.0-alpha.11 * Add `readMany` to `Service`. +* Allow `ResponseContext.redirect` to take a `Uri`. # 2.0.0-alpha.10 * All calls to `Service.parseId` are now affixed with the `` argument. diff --git a/lib/src/core/response_context.dart b/lib/src/core/response_context.dart index a1011815..a76aaccf 100644 --- a/lib/src/core/response_context.dart +++ b/lib/src/core/response_context.dart @@ -175,8 +175,8 @@ abstract class ResponseContext if (!isOpen) throw closed(); headers ..['content-type'] = 'text/html' - ..['location'] = url is String - ? url + ..['location'] = (url is String || url is Uri) + ? url.toString() : app.navigate(url as Iterable, absolute: absolute); statusCode = code ?? 302; write('''