filestorage
Advanced tools
Comparing version 1.3.0 to 1.4.0
33
index.js
@@ -557,3 +557,3 @@ var fs = require('fs'); | ||
h['Cache-Control'] = 'max-age=0'; | ||
h['Cache-Control'] = 'max-age=5'; | ||
h['Content-Type'] = 'multipart/form-data; boundary=' + BOUNDARY; | ||
@@ -784,3 +784,17 @@ | ||
var isRange = false; | ||
var expires = new Date(); | ||
expires.setMonth(expires.getMonth() + 15); | ||
var headers = { | ||
'Content-Type': stat.type, | ||
'Etag': stat.stamp, | ||
'Last-Modified': new Date(stat.stamp).toUTCString(), | ||
'Accept-Ranges': 'bytes', | ||
'Cache-Control': 'public, max-age=11111111', | ||
'Expires': expires, | ||
'X-Powered-By': 'node.js FileStorage', | ||
'Vary': 'Accept-Encoding', | ||
'Access-Control-Allow-Origin': '*' | ||
}; | ||
if (req) { | ||
@@ -790,3 +804,3 @@ | ||
res.success = true; | ||
res.writeHead(304); | ||
res.writeHead(304, headers); | ||
res.end(); | ||
@@ -817,17 +831,4 @@ return; | ||
var expires = new Date(); | ||
expires.setMonth(expires.getMonth() + 2); | ||
headers['Content-Length'] = length; | ||
var headers = { | ||
'Content-Type': stat.type, | ||
'Content-Length': length, | ||
'Etag': stat.stamp, | ||
'Last-Modified': new Date(stat.stamp).toUTCString(), | ||
'Accept-Ranges': 'bytes', | ||
'Cache-Control': 'public', | ||
'Expires': expires, | ||
'X-Powered-By': 'node.js FileStorage', | ||
'Vary': 'Accept-Encoding' | ||
}; | ||
if (stat.width > 0) | ||
@@ -834,0 +835,0 @@ headers['X-Image-Width'] = stat.width; |
{ | ||
"name": "filestorage", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "File storage for file uploading.", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
40271
968
3