| Index: pkg/http_server/lib/src/virtual_directory.dart
|
| diff --git a/pkg/http_server/lib/src/virtual_directory.dart b/pkg/http_server/lib/src/virtual_directory.dart
|
| index 88a9d50cc8fcc46b9f29282e1d723e0c28192801..7665a71e7cb40dec5f1b6793a54a273e9af19c97 100644
|
| --- a/pkg/http_server/lib/src/virtual_directory.dart
|
| +++ b/pkg/http_server/lib/src/virtual_directory.dart
|
| @@ -97,7 +97,11 @@ class VirtualDirectory {
|
| path = normalize(path);
|
| // If we jail to root, the relative path can never go up.
|
| if (jailRoot && split(path).first == "..") return new Future.value(null);
|
| - String fullPath() => join(root, path);
|
| + String fullPath({bool endSlash: false}) {
|
| + var p = join(root, path);
|
| + if (endSlash && path != ".") p = "$p$separator";
|
| + return p;
|
| + }
|
| return FileSystemEntity.type(fullPath(), followLinks: false)
|
| .then((type) {
|
| switch (type) {
|
| @@ -110,7 +114,7 @@ class VirtualDirectory {
|
| case FileSystemEntityType.DIRECTORY:
|
| if (segments.current == null) {
|
| if (allowDirectoryListing) {
|
| - return new Directory(fullPath());
|
| + return new Directory(fullPath(endSlash: true));
|
| }
|
| } else {
|
| if (_invalidPathRegExp.hasMatch(segments.current)) break;
|
|
|