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

ali-api-gateway

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ali-api-gateway - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "ali-api-gateway",
"version": "1.0.0",
"version": "1.0.1",
"description": "proxy ali api gate way",

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

@@ -30,6 +30,6 @@ 'use strict';

body: err.message || err || 'server error',
cookies: ctx.cookies || {},
headers: ctx.headers || {}
cookies: ctx.res.cookies || {},
headers: ctx.res.headers || {}
};
});
};

@@ -37,9 +37,15 @@ 'use strict';

api.use(function *(ctx) {
ctx.setHeaders('test', 'test');
ctx.setCookie('test', 'test');
throw ctx.newError(400, 'error params');
});
api.wrap()(new Buffer(JSON.stringify(Object.assign(basicEvent, {test: 'test'}))), Object.assign(basicContext, {haha: 'haha'}), function(err, res) {
t.true(res.statusCode === 400);
t.true(res.body === 'error params');
t.deepEqual(res, {
statusCode: 400,
body: 'error params',
cookies: { test: 'test' },
headers: { test: 'test' }
});
t.end();
});
});
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