Fix expiry
This commit is contained in:
parent
734d5f8547
commit
fa3474404c
3 changed files with 4 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
# angel_static
|
# static
|
||||||
|
|
||||||
[](https://pub.dartlang.org/packages/angel_static)
|
[](https://pub.dartlang.org/packages/angel_static)
|
||||||
[](https://travis-ci.org/angel-dart/static)
|
[](https://travis-ci.org/angel-dart/static)
|
||||||
|
|
||||||
Static server middleware for Angel.
|
Static server middleware for Angel.
|
||||||
|
|
|
@ -162,7 +162,7 @@ class CachingVirtualDirectory extends VirtualDirectory {
|
||||||
void setCachedHeaders(
|
void setCachedHeaders(
|
||||||
File file, FileStat stat, RequestContext req, ResponseContext res) {
|
File file, FileStat stat, RequestContext req, ResponseContext res) {
|
||||||
var privacy = accessLevelToString(accessLevel ?? CacheAccessLevel.PUBLIC);
|
var privacy = accessLevelToString(accessLevel ?? CacheAccessLevel.PUBLIC);
|
||||||
var expiry = new DateTime.now()..add(new Duration(seconds: maxAge ?? 0));
|
var expiry = new DateTime.now().add(new Duration(seconds: maxAge ?? 0));
|
||||||
|
|
||||||
res.headers
|
res.headers
|
||||||
..[HttpHeaders.CACHE_CONTROL] = '$privacy, max-age=${maxAge ?? 0}'
|
..[HttpHeaders.CACHE_CONTROL] = '$privacy, max-age=${maxAge ?? 0}'
|
||||||
|
|
|
@ -4,7 +4,7 @@ environment:
|
||||||
sdk: ">=1.19.0"
|
sdk: ">=1.19.0"
|
||||||
homepage: https://github.com/angel-dart/angel_static
|
homepage: https://github.com/angel-dart/angel_static
|
||||||
author: thosakwe <thosakwe@gmail.com>
|
author: thosakwe <thosakwe@gmail.com>
|
||||||
version: 1.1.4+1
|
version: 1.1.4+2
|
||||||
dependencies:
|
dependencies:
|
||||||
angel_framework: ^1.0.0-dev
|
angel_framework: ^1.0.0-dev
|
||||||
intl: ">=0.0.0 <1.0.0"
|
intl: ">=0.0.0 <1.0.0"
|
||||||
|
|
Loading…
Reference in a new issue