Bump to 2.1.1
This commit is contained in:
parent
2d44ba1693
commit
9a038ded48
3 changed files with 6 additions and 2 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
# 2.1.1
|
||||||
|
* URI-encode paths in directory listing. This produces correct URL's, always.
|
||||||
|
|
||||||
# 2.1.0
|
# 2.1.0
|
||||||
* Include support for the `Range` header.
|
* Include support for the `Range` header.
|
||||||
* Use MD5 for etags, instead of a weak ETag.
|
* Use MD5 for etags, instead of a weak ETag.
|
||||||
|
|
|
@ -72,7 +72,7 @@ class VirtualDirectory {
|
||||||
Future<bool> handleRequest(RequestContext req, ResponseContext res) {
|
Future<bool> handleRequest(RequestContext req, ResponseContext res) {
|
||||||
if (req.method != 'GET' && req.method != 'HEAD')
|
if (req.method != 'GET' && req.method != 'HEAD')
|
||||||
return new Future<bool>.value(true);
|
return new Future<bool>.value(true);
|
||||||
var path = req.path.replaceAll(_straySlashes, '');
|
var path = req.uri.path.replaceAll(_straySlashes, '');
|
||||||
|
|
||||||
if (_prefix?.isNotEmpty == true && !path.startsWith(_prefix))
|
if (_prefix?.isNotEmpty == true && !path.startsWith(_prefix))
|
||||||
return new Future<bool>.value(true);
|
return new Future<bool>.value(true);
|
||||||
|
@ -196,6 +196,7 @@ class VirtualDirectory {
|
||||||
if (relative.isNotEmpty) href = '/' + relative + '/' + stub;
|
if (relative.isNotEmpty) href = '/' + relative + '/' + stub;
|
||||||
|
|
||||||
if (entity is Directory) href += '/';
|
if (entity is Directory) href += '/';
|
||||||
|
href = Uri.encodeFull(href);
|
||||||
|
|
||||||
res.write('<li><a href="$href">$type $stub</a></li>');
|
res.write('<li><a href="$href">$type $stub</a></li>');
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ environment:
|
||||||
sdk: ">=1.8.0 <3.0.0"
|
sdk: ">=1.8.0 <3.0.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: 2.1.0
|
version: 2.1.1
|
||||||
dependencies:
|
dependencies:
|
||||||
angel_framework: ^2.0.0-alpha
|
angel_framework: ^2.0.0-alpha
|
||||||
convert: ^2.0.0
|
convert: ^2.0.0
|
||||||
|
|
Loading…
Reference in a new issue