diff --git a/packages/static/lib/src/cache.dart b/packages/static/lib/src/cache.dart index b85a2845..df160f66 100644 --- a/packages/static/lib/src/cache.dart +++ b/packages/static/lib/src/cache.dart @@ -194,4 +194,5 @@ class CachingVirtualDirectory extends VirtualDirectory { } } +// TODO: Refactor enum CacheAccessLevel { PUBLIC, PRIVATE } diff --git a/packages/static/lib/src/virtual_directory.dart b/packages/static/lib/src/virtual_directory.dart index 0bcda945..1f96276c 100644 --- a/packages/static/lib/src/virtual_directory.dart +++ b/packages/static/lib/src/virtual_directory.dart @@ -116,7 +116,7 @@ class VirtualDirectory { if (_prefix.isNotEmpty) { // Only replace the *first* incidence // Resolve: https://github.com/angel-dart/angel/issues/41 - path = path.replaceFirst(RegExp('^' + _pathify(_prefix)), ''); + path = path.replaceFirst(RegExp('^${_pathify(_prefix)}'), ''); } if (path.isEmpty) path = '.'; @@ -234,7 +234,7 @@ class VirtualDirectory { var href = stub; if (relative.isNotEmpty) { - href = '/' + relative + '/' + stub; + href = '/$relative/$stub'; } if (entity is Directory) { @@ -370,7 +370,7 @@ class VirtualDirectory { 'application/octet-stream'); res.statusCode = 206; res.headers['content-length'] = len.toString(); - res.headers['content-range'] = 'bytes ' + item.toContentRange(total); + res.headers['content-range'] = 'bytes ${item.toContentRange(total)}'; await stream.cast>().pipe(res); return false; } else {