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

nodecaf

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodecaf - npm Package Compare versions

Comparing version 0.12.3 to 0.12.4

17

lib/api.js

@@ -89,11 +89,12 @@ const assert = require('assert');

function parseSignedCookies(cconf, input){
for(let key in input.cookies)
// TODO 's:' needed??
if(input.cookies[key].substr(0, 2) == 's:'){
let val = cookieSignature.unsign(input.cookies[key].substr(2), cconf.secret);
if(val){
input.signedCookies[key] = val;
delete input.cookies[key];
}
if(!cconf?.secret)
return;
for(let key in input.cookies){
var val = cookieSignature.unsign(input.cookies[key], cconf?.secret);
if(val){
input.signedCookies[key] = val;
delete input.cookies[key];
}
}
}

@@ -100,0 +101,0 @@

@@ -156,10 +156,10 @@ const { sign } = require('cookie-signature');

if(opts.signed && !this.conf.cookie?.secret)
value = String(value);
if(value && opts.signed && !this.conf.cookie?.secret)
throw new Error('Trying to sign cookies when secret is not defined');
value = String(value);
if(opts.signed && value)
value = sign(value, this.conf.cookie.secret);
if(opts.signed)
value = 's:' + sign(value, this.conf.cookie.secret);
if('maxAge' in opts) {

@@ -166,0 +166,0 @@ opts.expires = new Date(Date.now() + opts.maxAge);

{
"name": "nodecaf",
"version": "0.12.3",
"version": "0.12.4",
"description": "Nodecaf is a light framework for developing RESTful Apps in a quick and convenient manner.",

@@ -5,0 +5,0 @@ "main": "lib/main.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