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 # 2.0.0-alpha.11
* Add `readMany` to `Service`. * Add `readMany` to `Service`.
* Allow `ResponseContext.redirect` to take a `Uri`.
# 2.0.0-alpha.10 # 2.0.0-alpha.10
* All calls to `Service.parseId` are now affixed with the `<Id>` argument. * 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(); if (!isOpen) throw closed();
headers headers
..['content-type'] = 'text/html' ..['content-type'] = 'text/html'
..['location'] = url is String ..['location'] = (url is String || url is Uri)
? url ? url.toString()
: app.navigate(url as Iterable, absolute: absolute); : app.navigate(url as Iterable, absolute: absolute);
statusCode = code ?? 302; statusCode = code ?? 302;
write(''' write('''