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

egg-jsonp

Package Overview
Dependencies
Maintainers
4
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-jsonp - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

9

app/extend/application.js

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

options = Object.assign({}, defaultOptions, options);
if (!Array.isArray(options.callback)) options.callback = [ options.callback ];

@@ -60,3 +61,3 @@ const csrfEnable = this.plugins.security && this.plugins.security.enable // security enable

// generate jsonp body
const jsonpFunction = this.query[options.callback];
const jsonpFunction = getJsonpFunction(this.query, options.callback);
if (jsonpFunction) {

@@ -109,1 +110,7 @@ this.set('x-content-type-options', 'nosniff');

}
function getJsonpFunction(query, callbacks) {
for (const callback of callbacks) {
if (query[callback]) return query[callback];
}
}

4

config/config.default.js

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

* @member Config#jsonp
* @property {String} callback - jsonp callback method key, default to `_callback`
* @property {String} callback - jsonp callback method key, default to `['_callback', 'callback' ]`
* @property {Number} limit - callback method name's max length, default to `50`

@@ -14,5 +14,5 @@ * @property {Boolean} csrf - enable csrf check or not. default to false

limit: 50,
callback: '_callback',
callback: [ '_callback', 'callback' ],
csrf: false,
whiteList: undefined,
};
1.1.0 / 2017-06-01
==================
* test: test on node 8
* feat: support _callback and callback
1.0.0 / 2017-01-23

@@ -3,0 +9,0 @@ ==================

{
"name": "egg-jsonp",
"version": "1.0.0",
"version": "1.1.0",
"description": "jsonp support for egg",

@@ -26,11 +26,11 @@ "eggPlugin": {

"devDependencies": {
"autod": "^2.7.1",
"egg": "^0.8.0",
"egg-bin": "^1.10.0",
"egg-ci": "^1.1.0",
"egg-mock": "^2.0.0",
"eslint": "^3.13.1",
"eslint-config-egg": "^3.2.0",
"supertest": "^2.0.1",
"webstorm-disable-index": "^1.1.2"
"autod": "^2.8.0",
"egg": "^1.4.0",
"egg-bin": "^3.4.1",
"egg-ci": "^1.6.0",
"egg-mock": "^3.7.1",
"eslint": "^3.19.0",
"eslint-config-egg": "^4.2.0",
"supertest": "^3.0.0",
"webstorm-disable-index": "^1.2.0"
},

@@ -57,3 +57,3 @@ "engines": {

"ci": {
"version": "6, 7"
"version": "6, 7, 8"
},

@@ -60,0 +60,0 @@ "repository": {

@@ -43,3 +43,3 @@ # egg-jsonp

* {String} callback - jsonp callback method key, default to `_callback`
* {String|Array} callback - jsonp callback method key, default to `[ '_callback', 'callback' ]`
* {Number} limit - callback method name's max length, default to `50`

@@ -46,0 +46,0 @@ * {Boolean} csrf - enable csrf check or not. default to false

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