diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a510dd2..1b8b343f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.3.0-alpha+1 +* ETags once again only encode the first 50 bytes of files. Resolves [#27](https://github.com/angel-dart/static/issues/27). + # 1.3.0-alpha * Removed file transformers. * `VirtualDirectory` is no longer an `AngelPlugin`, and instead exposes a `handleRequest` middleware. diff --git a/lib/src/cache.dart b/lib/src/cache.dart index 329883e7..64458078 100644 --- a/lib/src/cache.dart +++ b/lib/src/cache.dart @@ -15,7 +15,7 @@ String formatDateForHttp(DateTime dt) => _fmt.format(dt.toUtc()) + ' GMT'; /// Generates a weak ETag from the given buffer. String weakEtag(List buf) { - return 'W/${buf.length}' + BASE64URL.encode(buf); + return 'W/${buf.length}' + BASE64URL.encode(buf.take(50).toList()); } /// Returns a string representation of the given [CacheAccessLevel]. diff --git a/pubspec.yaml b/pubspec.yaml index 983facd8..dea1f22c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ environment: sdk: ">=1.19.0" homepage: https://github.com/angel-dart/static author: Tobe O -version: 1.3.0-alpha +version: 1.3.0-alpha+1 dependencies: angel_framework: ^1.1.0-alpha file: ^2.0.0