Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

route-cache

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

route-cache - npm Package Compare versions

Comparing version 0.2.6 to 0.2.7

test/appCache.js

14

index.js

@@ -42,5 +42,15 @@ 'use strict';

function rawSend(data, isJson) {
didHandle = true;
var key = req.originalUrl;
// pass-through for Buffer - not supported
if (typeof data === 'object') {
if (Buffer.isBuffer(data)) {
queues[key]=[]; // clear queue
res.set('Content-Length', data.length);
res.original_send(data);
return;
}
}
didHandle = true;
var body = data instanceof Buffer ? data.toString() : data;

@@ -52,3 +62,3 @@ if (res.statusCode < 400) cacheStore.put(key, { body: body, isJson: isJson }, ttl);

var subscriber = null;
while (subscriber === queues[key].shift()) {
while (subscriber = queues[key].shift()) {
if (subscriber) {

@@ -55,0 +65,0 @@ process.nextTick(subscriber);

2

package.json
{
"name": "route-cache",
"version": "0.2.6",
"version": "0.2.7",
"description": "express middleware for caching your routes",

@@ -5,0 +5,0 @@ "main": "index.js",

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