Strict pushstate

This commit is contained in:
Tobe O 2017-11-28 16:09:16 -05:00
parent b1de9715d4
commit 6945c538c3
3 changed files with 6 additions and 3 deletions

View file

@ -1,4 +1,7 @@
# 1.3.1 # 1.3.0
* `pushState` uses `strict` mode when `accepts` is passed.
# 1.3.0-alpha+2
* Added an `accepts` option to `pushState`. * Added an `accepts` option to `pushState`.
* Added optional directory listings. * Added optional directory listings.

View file

@ -86,7 +86,7 @@ class VirtualDirectory {
if (path == vPath) return new Future<bool>.value(true); if (path == vPath) return new Future<bool>.value(true);
if (accepts?.isNotEmpty == true) { if (accepts?.isNotEmpty == true) {
if (!accepts.any(req.accepts)) return new Future<bool>.value(true); if (!accepts.any((x) => req.accepts(x, strict: true))) return new Future<bool>.value(true);
} }
return servePath(vPath, req, res); return servePath(vPath, req, res);

View file

@ -4,7 +4,7 @@ environment:
sdk: ">=1.19.0" sdk: ">=1.19.0"
homepage: https://github.com/angel-dart/static homepage: https://github.com/angel-dart/static
author: Tobe O <thosakwe@gmail.com> author: Tobe O <thosakwe@gmail.com>
version: 1.3.0-alpha+2 version: 1.3.0
dependencies: dependencies:
angel_framework: ^1.1.0-alpha angel_framework: ^1.1.0-alpha
file: ^2.0.0 file: ^2.0.0