nodecommons-express
Advanced tools
Comparing version 1.4.4 to 1.4.5
@@ -16,4 +16,4 @@ import * as express from 'express'; | ||
static isNpm1985TimestampFile(file: string): boolean; | ||
static setLastModifiedNow(res: express.Response): void; | ||
static autoNpm1985TimestampFile(file: string, res: express.Response): void; | ||
static setLastModified(res: express.Response, timestamp: Date): void; | ||
static autoNpm1985TimestampFile(file: string, res: express.Response, timestamp: Date): void; | ||
} |
@@ -107,10 +107,10 @@ "use strict"; | ||
// See note 2 at top of CommonsExpressServer | ||
static setLastModifiedNow(res) { | ||
res.setHeader('Last-Modified', new Date().toUTCString()); | ||
static setLastModified(res, timestamp) { | ||
res.setHeader('Last-Modified', timestamp.toUTCString()); | ||
} | ||
// See note 2 at top of CommonsExpressServer | ||
static autoNpm1985TimestampFile(file, res) { | ||
static autoNpm1985TimestampFile(file, res, timestamp) { | ||
if (!CommonsExpress.isNpm1985TimestampFile(file)) | ||
return; | ||
CommonsExpress.setLastModifiedNow(res); | ||
CommonsExpress.setLastModified(res, timestamp); | ||
} | ||
@@ -117,0 +117,0 @@ } |
@@ -14,2 +14,3 @@ /// <reference types="node" /> | ||
private usingNpmResources; | ||
private nodeStartTime; | ||
constructor(ex: express.Express, server: http.Server | https.Server, port: number); | ||
@@ -16,0 +17,0 @@ setUsingNpmResources(state?: boolean): void; |
@@ -50,2 +50,3 @@ "use strict"; | ||
this.usingNpmResources = false; | ||
this.nodeStartTime = new Date(); | ||
} | ||
@@ -136,3 +137,3 @@ static nginxProxyPath(p) { | ||
if (this.usingNpmResources) { | ||
commons_express_1.CommonsExpress.autoNpm1985TimestampFile(p, res); | ||
commons_express_1.CommonsExpress.autoNpm1985TimestampFile(p, res, this.nodeStartTime); | ||
} | ||
@@ -147,3 +148,3 @@ } | ||
if (this.usingNpmResources) { | ||
commons_express_1.CommonsExpress.autoNpm1985TimestampFile(p, res); | ||
commons_express_1.CommonsExpress.autoNpm1985TimestampFile(p, res, new Date()); | ||
} | ||
@@ -158,3 +159,3 @@ } | ||
if (this.usingNpmResources) { | ||
commons_express_1.CommonsExpress.autoNpm1985TimestampFile(p, res); | ||
commons_express_1.CommonsExpress.autoNpm1985TimestampFile(p, res, this.nodeStartTime); | ||
} | ||
@@ -179,3 +180,3 @@ } | ||
// See note 2 at top | ||
commons_express_1.CommonsExpress.setLastModifiedNow(res); | ||
commons_express_1.CommonsExpress.setLastModified(res, this.nodeStartTime); | ||
res.sendFile(path.join(absolute, '/index.html')); | ||
@@ -182,0 +183,0 @@ }); |
{ | ||
"name": "nodecommons-express", | ||
"version": "1.4.4", | ||
"version": "1.4.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63724
832