New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cache-control

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cache-control - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

9

index.js

@@ -6,2 +6,3 @@ var path = require('path');

var url = require('fast-url-parser');
var regular = require('regular');

@@ -24,4 +25,4 @@ module.exports = function (options) {

if (val === false) res.setHeader('Cache-Control', 'no-cache');
if (_.isNumber(val)) res.setHeader('Cache-Control', 'public, max-age=' + val.toString());
if (_.isString(val)) res.setHeader('Cache-Control', val);
else if (isNumber(val)) res.setHeader('Cache-Control', 'public, max-age=' + val.toString());
else if (_.isString(val)) res.setHeader('Cache-Control', val);
}

@@ -33,3 +34,7 @@ });

next();
function isNumber (val) {
return _.isNumber(val) || regular.number.test(val);
}
};
};
{
"name": "cache-control",
"version": "0.1.0",
"version": "0.1.1",
"description": "Express/Connect middleware to set url cache options with globs",

@@ -37,4 +37,5 @@ "main": "index.js",

"minimatch": "^0.4.0",
"regular": "^0.1.6",
"slasher": "^0.1.5"
}
}

@@ -5,3 +5,3 @@ var cacheControl = require('../');

var caches = {
'index.html': 1000,
'index.html': "31536000",
'none.html': false,

@@ -22,3 +22,3 @@ 'private.html': 'private, max-age=300'

.get('/index.html')
.expect('Cache-Control', 'public, max-age=1000')
.expect('Cache-Control', 'public, max-age=31536000')
.end(done);

@@ -25,0 +25,0 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc