Skip to content
This repository has been archived by the owner on Feb 17, 2020. It is now read-only.

Commit

Permalink
Bump to 2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
thosakwe committed Nov 14, 2018
1 parent 2d44ba1 commit 9a038de
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 2 additions & 1 deletion lib/src/virtual_directory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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>');
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9a038de

Please sign in to comment.