Fix expiry

This commit is contained in:
thosakwe 2017-06-14 05:37:39 -04:00
parent 734d5f8547
commit fa3474404c
3 changed files with 4 additions and 4 deletions

View file

@ -1,6 +1,6 @@
# angel_static
# static
[![version 1.1.4+1](https://img.shields.io/badge/pub-1.1.4+1-brightgreen.svg)](https://pub.dartlang.org/packages/angel_static)
[![Pub](https://img.shields.io/pub/v/angel_static.svg)](https://pub.dartlang.org/packages/angel_static)
[![build status](https://travis-ci.org/angel-dart/static.svg?branch=master)](https://travis-ci.org/angel-dart/static)
Static server middleware for Angel.

View file

@ -162,7 +162,7 @@ class CachingVirtualDirectory extends VirtualDirectory {
void setCachedHeaders(
File file, FileStat stat, RequestContext req, ResponseContext res) {
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
..[HttpHeaders.CACHE_CONTROL] = '$privacy, max-age=${maxAge ?? 0}'

View file

@ -4,7 +4,7 @@ environment:
sdk: ">=1.19.0"
homepage: https://github.com/angel-dart/angel_static
author: thosakwe <thosakwe@gmail.com>
version: 1.1.4+1
version: 1.1.4+2
dependencies:
angel_framework: ^1.0.0-dev
intl: ">=0.0.0 <1.0.0"