Allow redir to Uri

This commit is contained in:
Tobe O 2018-11-07 21:37:00 -05:00
parent 7fec4c243d
commit 76532f9509
2 changed files with 3 additions and 2 deletions

View file

@ -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 `<Id>` argument.

View file

@ -175,8 +175,8 @@ abstract class ResponseContext<RawResponse>
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('''