diff --git a/CHANGELOG.md b/CHANGELOG.md index 329b1625..5598e4df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.1.2+1 +* Fix a typo that prevented `Range` requests from working. + # 2.1.2 * Patch support for range+streaming in Caching server. diff --git a/lib/src/cache.dart b/lib/src/cache.dart index 8e9eb9ba..b3edbb37 100644 --- a/lib/src/cache.dart +++ b/lib/src/cache.dart @@ -158,7 +158,7 @@ class CachingVirtualDirectory extends VirtualDirectory { } setCachedHeaders(stat.modified, req, res); - return res.streamFile(file).then((_) => false); + return super.serveFile(file, stat, req, res); }); } } diff --git a/lib/src/virtual_directory.dart b/lib/src/virtual_directory.dart index bc24dc2a..1b85d584 100644 --- a/lib/src/virtual_directory.dart +++ b/lib/src/virtual_directory.dart @@ -240,7 +240,7 @@ class VirtualDirectory { res.contentType = new MediaType.parse(type); if (useBuffer == true) res.useBuffer(); - if (req.headers.value('range')?.startsWith('bytes ') != true) { + if (req.headers.value('range')?.startsWith('bytes=') != true) { await res.streamFile(file); } else { var header = new RangeHeader.parse(req.headers.value('range')); diff --git a/pubspec.yaml b/pubspec.yaml index d81c9611..8948b2a5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ environment: sdk: ">=1.8.0 <3.0.0" homepage: https://github.com/angel-dart/static author: Tobe O -version: 2.1.2 +version: 2.1.2+1 dependencies: angel_framework: ^2.0.0-alpha convert: ^2.0.0