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

wso2-apimgr

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wso2-apimgr - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

14

js/proxy.js

@@ -18,3 +18,3 @@

Proxy.prototype.ajax = function(request, callback) {
var debug = this.config.debug, req, data;
var debug = this.config.debug, req, data, cookies;
if (debug) console.log('Proxy.ajax', JSON.stringify(request));

@@ -36,8 +36,14 @@ if (typeof request.method === 'undefined') {

req.open(request.method, request.url, true);
if (this.cookie) {
req.withCredentials = true;
req.withCredentials = true;
if (this.cookie && this.cookie.length>0) {
req.setDisableHeaderCheck(true);
req.setRequestHeader('Cookie', this.cookie);
for (i=0,m=this.cookie.length;i<m;i++){
console.log("adding", this.cookie[i]);
if (i>0) cookies += "; ";
cookies += this.cookie[i];
}
req.setRequestHeader('Cookie', cookies);
}
if (debug) console.log('Proxy.ajax send', request.method, request.url, data, this.cookie);
if (debug) console.log('Proxy.ajax send', request.method, request.url, data, cookies);
if (request.method === 'GET') {

@@ -44,0 +50,0 @@ req.send();

@@ -6,3 +6,3 @@

var cookieRegex = /(JSESSIONID=\w*)/;
var cookieRegex = /^(\w*=\w*)/;

@@ -29,11 +29,12 @@ function Store(proxy){

this.proxy.ajax(request, function(err, resp, raw) {
var cookie = raw.getResponseHeader('Set-Cookie');
if (err === null && cookie !== null){
cookie = cookieRegex.exec(cookie);
if (cookie.length >0){
cookie = cookie[0];
_this.proxy.cookie = cookie;
if (_this.proxy.config.debug) console.log('Cookie ', cookie);
}
}
var cookies = raw.getResponseHeader('Set-Cookie');
var headers=[];
for (i=0, m=cookies.length; i<m; i++) {
var cookie = cookieRegex.exec(cookies[i]);
if (cookie && cookie.length >0){
headers.push(cookie[0]);
}
}
if (_this.proxy.config.debug) console.log('Cookie Headers', headers);
_this.proxy.cookie=headers;
callback (err,resp);

@@ -58,3 +59,3 @@ });

if (err === null) {
_this.proxy.cookie = null;
_this.proxy.cookie = [];
}

@@ -61,0 +62,0 @@ callback(err, resp);

{
"name": "wso2-apimgr",
"version": "0.0.5",
"version": "0.0.6",
"description": "A lightweight JS SDK to work with the WSO2 API Manager",

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

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