Only add date if date exists.
This commit is contained in:
parent
ff264aa69a
commit
494ca0560b
|
@ -55,6 +55,7 @@ exports.minifyJS = function(req, res, next)
|
||||||
res.header("Content-Type","text/javascript");
|
res.header("Content-Type","text/javascript");
|
||||||
|
|
||||||
statFile(filename, function (error, date, exists) {
|
statFile(filename, function (error, date, exists) {
|
||||||
|
if (date) {
|
||||||
date = new Date(date);
|
date = new Date(date);
|
||||||
res.setHeader('last-modified', date.toUTCString());
|
res.setHeader('last-modified', date.toUTCString());
|
||||||
res.setHeader('date', (new Date()).toUTCString());
|
res.setHeader('date', (new Date()).toUTCString());
|
||||||
|
@ -63,6 +64,7 @@ exports.minifyJS = function(req, res, next)
|
||||||
res.setHeader('expires', expiresDate.toUTCString());
|
res.setHeader('expires', expiresDate.toUTCString());
|
||||||
res.setHeader('cache-control', 'max-age=' + server.maxAge);
|
res.setHeader('cache-control', 'max-age=' + server.maxAge);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
res.writeHead(500, {});
|
res.writeHead(500, {});
|
||||||
|
|
Loading…
Reference in New Issue