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

swagger-node-express

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swagger-node-express - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

24

Common/node/swagger.js

@@ -122,5 +122,4 @@ /**

var op = api.operations[opKey];
var path = api.path.replace(/{.*\}/, "*");
if (!canAccessResource(req, route + path, op.httpMethod)) {
var path = api.path.replace(formatString, "").replace(/{.*\}/, "*");
if (!canAccessResource(req, path, op.httpMethod)) {
excludedPaths.push(op.httpMethod + ":" + api.path); }

@@ -330,3 +329,6 @@ }

exports.setHeaders(res);
if (!canAccessResource(req, req.url.substr(1).split('?')[0].replace('.json', '.*'), req.method)) {
// todo: needs to do smarter matching against the defined paths
var path = req.url.split('?')[0].replace(jsonSuffix, "").replace(/{.*\}/, "*");
if (!canAccessResource(req, path, req.method)) {
res.send(JSON.stringify({"description":"forbidden", "code":403}), 403);

@@ -503,3 +505,3 @@ } else {

function error(code, description) {
return {"code" : code, "reason" : description};
return {"code" : code, "description" : description};
}

@@ -520,17 +522,17 @@

if (!res) {
return {"code": 404, "reason": field + ' not found'}; }
return {"code": 404, "description": field + ' not found'}; }
else {
res.send({"code": 404, "reason": field + ' not found'}, 404); }
res.send({"code": 404, "description": field + ' not found'}, 404); }
},
'invalid': function(field, res) {
if (!res) {
return {"code": 400, "reason": 'invalid ' + field}; }
return {"code": 400, "description": 'invalid ' + field}; }
else {
res.send({"code": 400, "reason": 'invalid ' + field}, 404); }
res.send({"code": 400, "description": 'invalid ' + field}, 404); }
},
'forbidden': function(res) {
if (!res) {
return {"code": 403, "reason": 'forbidden' }; }
return {"code": 403, "description": 'forbidden' }; }
else {
res.send({"code": 403, "reason": 'forbidden'}, 403); }
res.send({"code": 403, "description": 'forbidden'}, 403); }
}

@@ -537,0 +539,0 @@ };

{
"name": "swagger-node-express",
"version": "1.2.2",
"version": "1.2.3",
"author": {

@@ -5,0 +5,0 @@ "name": "Tony Tam",

Sorry, the diff of this file is not supported yet

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