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

restify

Package Overview
Dependencies
Maintainers
1
Versions
184
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

restify - npm Package Compare versions

Comparing version 2.6.3 to 2.7.0

9

CHANGES.md
# restify Changelog
## 2.6.4 (not yet released)
## not yet released
## 2.7.0
- #547 Added mapFiles option to bodyParser
- #552 PUT JsonClient test should use PUT not POST
- #550 Make router preflight code more readable
- #548 Allow custom handling of multipart data.
## 2.6.3

@@ -6,0 +13,0 @@

41

lib/plugins/multipart_parser.js

@@ -43,2 +43,11 @@ // Copyright 2012 Mark Cavage, Inc. All rights reserved.

form.onPart = function onPart(part) {
if (part.filename && options.multipartFileHandler)
options.multipartFileHandler(part, req);
else if (!part.filename && options.multipartHandler)
options.multipartHandler(part, req);
else
form.handlePart(part);
};
form.parse(req, function (err, fields, files) {

@@ -60,17 +69,19 @@ if (err)

Object.keys(files).forEach(function (f) {
if (req.params[f] && !override)
return (false);
var fs = require('fs');
return fs.readFile(
files[f].path,
'utf8',
function (ex, data) {
if (ex) {
return (false);
}
req.params[f] = data;
return (true);
});
});
if (options.mapFiles) {
Object.keys(files).forEach(function (f) {
if (req.params[f] && !override)
return (false);
var fs = require('fs');
return fs.readFile(
files[f].path,
'utf8',
function (ex, data) {
if (ex) {
return (false);
}
req.params[f] = data;
return (true);
});
});
}
}

@@ -77,0 +88,0 @@

@@ -415,2 +415,8 @@ // Copyright 2012 Mark Cavage, Inc. All rights reserved.

//Checks if header is in cors.ALLOWED_HEADERS
function inAllowedHeaders(header) {
header = header.toLowerCase();
return (cors.ALLOW_HEADERS.indexOf(header) !== -1);
}
// This is a very generic preflight handler - it does

@@ -431,11 +437,5 @@ // not handle requiring authentication, nor does it do

// Last, check request-headers
var ok = true;
/* JSSTYLED */
(headers || '').split(/\s*,\s*/).forEach(function (h) {
if (!h)
return;
var ok = !headers || headers.split(/\s*,\s*/).every(inAllowedHeaders);
h = h.toLowerCase();
ok = cors.ALLOW_HEADERS.indexOf(h) !== -1 && ok;
});
if (!ok)

@@ -442,0 +442,0 @@ return (false);

@@ -36,3 +36,3 @@ {

"description": "REST framework",
"version": "2.6.3",
"version": "2.7.0",
"repository": {

@@ -50,3 +50,3 @@ "type": "git",

"engines": {
"node": ">=0.8"
"node": ">=0.10"
},

@@ -53,0 +53,0 @@ "dependencies": {

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