v0.1.4+2
reverting a bad idea
diff --git a/lib/shelf_static.dart b/lib/shelf_static.dart
index 4fb0803..ebdea75 100644
--- a/lib/shelf_static.dart
+++ b/lib/shelf_static.dart
@@ -57,19 +57,19 @@
file = _tryDefaultFile(requestedPath, defaultDocument);
}
+ if (file == null) {
+ return new Response.notFound('Not Found');
+ }
+
if (!serveFilesOutsidePath) {
var resolvedPath = file.resolveSymbolicLinksSync();
// Do not serve a file outside of the original fileSystemPath
if (!p.isWithin(fileSystemPath, resolvedPath)) {
- file = null;
+ return new Response.notFound('Not Found');
}
}
- if (file == null) {
- return new Response.notFound('Not Found');
- }
-
if (fileType == FileSystemEntityType.DIRECTORY &&
!request.url.path.endsWith('/')) {
// when serving the default document for a directory, if the requested
diff --git a/pubspec.yaml b/pubspec.yaml
index 08c01fb..5e91d45 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: shelf_static
-version: 0.1.4+1
+version: 0.1.4+2
author: Kevin Moore <github@j832.com>
description: Static file server support for Shelf
homepage: https://github.com/kevmoo/shelf_static.dart