express-static
Advanced tools
Comparing version 1.2.5 to 1.2.6
const fs = require('fs'); | ||
const url = require('url'); | ||
const path = require('path'); | ||
const mime = require('mail2/mime'); | ||
const mime = require('mime2'); | ||
/** | ||
@@ -44,3 +44,4 @@ * [exports description] | ||
} | ||
if(new Date(req.headers['if-modified-since']) - stat.mtime == 0){ | ||
const mtime = new Date(stat.mtimeMs).toUTCString(); | ||
if(req.headers['if-modified-since'] === mtime){ | ||
res.writeHead(304); | ||
@@ -51,3 +52,3 @@ return res.end(); | ||
var charset = /^text\/|^application\/(javascript|json)/.test(type) ? 'UTF-8' : false; | ||
res.setHeader('Last-Modified', new Date(stat.mtimeMs).toUTCString()); | ||
res.setHeader('Last-Modified', mtime); | ||
res.setHeader('Content-Length', stat.size); | ||
@@ -54,0 +55,0 @@ res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : '')); |
{ | ||
"name": "express-static", | ||
"version": "1.2.5", | ||
"version": "1.2.6", | ||
"description": "serve static files for express", | ||
@@ -30,4 +30,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"mail2": "latest" | ||
"mime2": "latest" | ||
} | ||
} |
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
7271
109
+ Addedmime2@latest
- Removedmail2@latest
- Removedmail2@1.2.4(transitive)
- Removedmime2@0.0.2(transitive)
- Removedsmtp2@0.0.2(transitive)