New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.5 to 1.0.6

es5/set-header.js

4

es5/api.js

@@ -17,3 +17,3 @@ 'use strict';

var parseCookie = require('./parse-cookie.js');
var setHeaders = require('./set-headers.js');
var setHeader = require('./set-header.js');
var log = require('./log.js');

@@ -42,3 +42,3 @@

this.use(parseParams);
this.use(setHeaders);
this.use(setHeader);
this.use(parseCookie);

@@ -45,0 +45,0 @@ this.use(log);

@@ -12,2 +12,3 @@ 'use strict';

module.exports = function (middlewares) {
assert(Object.prototype.toString.call([]) === '[object Array]', 'compose middlewares is not Array');
return _regenerator2.default.mark(function _callee(ctx, next) {

@@ -14,0 +15,0 @@ var index, prev, middleware;

{
"name": "ali-api-gateway",
"version": "1.0.5",
"version": "1.0.6",
"description": "proxy ali api gate way",

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

@@ -29,1 +29,5 @@ # v0.0.7

* router.post(funcName, ...funcs) 接口更改。
# v1.0.5
* 添加 compose 函数。

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

const parseCookie = require('./parse-cookie.js');
const setHeaders = require('./set-headers.js');
const setHeader = require('./set-header.js');
const log = require('./log.js');

@@ -29,3 +29,3 @@

this.use(parseParams);
this.use(setHeaders);
this.use(setHeader);
this.use(parseCookie);

@@ -32,0 +32,0 @@ this.use(log);

const assert = require('assert');
module.exports = function(middlewares) {
assert(Object.prototype.toString.call([]) === '[object Array]', 'compose middlewares is not Array');
return function *(ctx, next) {

@@ -5,0 +6,0 @@ var index = middlewares.length;

@@ -14,3 +14,3 @@ 'use strict';

'content-type': 'application/json;charset=utf-8',
'Cookie': 'ubt_ssid=123123315; _utrace=59932606be7981c07521ad097; perf_ssid=worknr8afghevd3bzlrfw67hqqf9d; COFFEE_TOKEN=16e5179d-a2d0--8be7-5d1424851020',
'Cookie': 'test1=fasdf;test2=sfadf',
'Host': 'faas.ele.me',

@@ -24,6 +24,6 @@ 'Origin': 'https://board.faas.ele.me',

api.use(function *(ctx) {
t.deepEqual(ctx.cookie, { ubt_ssid: '123123315',
_utrace: '59932606be7981c07521ad097',
perf_ssid: 'worknr8afghevd3bzlrfw67hqqf9d',
COFFEE_TOKEN: '16e5179d-a2d0--8be7-5d1424851020' });
t.deepEqual(ctx.cookie, {
test1: 'fasdf',
test2: 'sfadf'
});
ctx.body = 'test';

@@ -30,0 +30,0 @@ });

@@ -37,3 +37,3 @@ 'use strict';

api.use(function *(ctx) {
ctx.setHeaders('test', 'test');
ctx.setHeader('test', 'test');
ctx.setCookie('test', 'test');

@@ -40,0 +40,0 @@ throw ctx.newError(400, 'error params');

@@ -39,3 +39,3 @@ 'use strict';

router.get('test', function *(ctx, next) {
ctx.setHeaders('test', 'test');
ctx.setHeader('test', 'test');
yield next();

@@ -42,0 +42,0 @@ }, function *(ctx) {

Sorry, the diff of this file is not supported yet

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