Bump to 2.1.1

This commit is contained in:
Tobe O 2018-11-14 00:58:35 -05:00
parent 2d44ba1693
commit 9a038ded48
3 changed files with 6 additions and 2 deletions

View file

@ -1,3 +1,6 @@
# 2.1.1
* URI-encode paths in directory listing. This produces correct URL's, always.
# 2.1.0
* Include support for the `Range` header.
* Use MD5 for etags, instead of a weak ETag.

View file

@ -72,7 +72,7 @@ class VirtualDirectory {
Future<bool> handleRequest(RequestContext req, ResponseContext res) {
if (req.method != 'GET' && req.method != 'HEAD')
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))
return new Future<bool>.value(true);
@ -196,6 +196,7 @@ class VirtualDirectory {
if (relative.isNotEmpty) href = '/' + relative + '/' + stub;
if (entity is Directory) href += '/';
href = Uri.encodeFull(href);
res.write('<li><a href="$href">$type $stub</a></li>');
}

View file

@ -4,7 +4,7 @@ environment:
sdk: ">=1.8.0 <3.0.0"
homepage: https://github.com/angel-dart/static
author: Tobe O <thosakwe@gmail.com>
version: 2.1.0
version: 2.1.1
dependencies:
angel_framework: ^2.0.0-alpha
convert: ^2.0.0