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

@3846masa/axios-cookiejar-support

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@3846masa/axios-cookiejar-support - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

3

lib/response-interceptor-wrapper.js
'use strict';
const url = require('url');
const settle = require('axios/lib/core/settle');

@@ -38,3 +39,3 @@

config.baseURL = undefined;
config.url = response.headers['location'];
config.url = config.url = url.resolve(response.config.url, response.headers['location'] || '');

@@ -41,0 +42,0 @@ local.redirectCount--;

{
"name": "@3846masa/axios-cookiejar-support",
"description": "Add tough-cookie support to axios.",
"version": "0.0.4",
"version": "0.0.5",
"author": "3846masa",

@@ -16,13 +16,13 @@ "browser": {

"devDependencies": {
"axios": "0.16.0",
"axios": "0.16.1",
"cookie": "0.3.1",
"decache": "4.1.0",
"eslint": "3.19.0",
"eslint-config-standard": "7.1.0",
"eslint-config-standard": "10.2.1",
"eslint-plugin-promise": "3.5.0",
"eslint-plugin-standard": "2.1.1",
"eslint-plugin-standard": "3.0.1",
"greenkeeper-postpublish": "1.0.1",
"intelli-espower-loader": "1.0.1",
"mocha": "3.2.0",
"nock": "9.0.11",
"mocha": "3.3.0",
"nock": "9.0.13",
"power-assert": "1.4.2"

@@ -29,0 +29,0 @@ },

@@ -111,2 +111,49 @@ 'use strict';

});
it('should redirect to relative path', () => {
nockHost.post('/').reply(302, null, {
'Location': '/redirect'
});
nockHost.get('/redirect').reply(200);
return axios.post('https://example.com')
.then((res) => {
assert.strictEqual(res.status, 200);
});
});
it('should redirect to relative path, after redirect to different domain', () => {
let anotherNockHost = nock('http://another.com');
anotherNockHost.get('/redirect').reply(302, null, {
'Location': '/final'
});
anotherNockHost.get('/final').reply(200, 'final');
nockHost.post('/').reply(302, null, {
'Location': 'http://another.com/redirect'
});
return axios.post('http://example.com')
.then((res) => {
assert.strictEqual(res.status, 200);
assert.strictEqual(res.data, 'final');
});
});
it('should redirect to relative path, jumping through a different domain that is different than `baseURL`', () => {
let anotherNockHost = nock('http://another.com');
anotherNockHost.get('/redirect').reply(302, null, {
'Location': '/final'
});
anotherNockHost.get('/final').reply(200, 'final');
nockHost.post('/').reply(302, null, {
'Location': 'http://another.com/redirect'
});
return axios.create({ baseURL: 'http://example.com' })
.post('http://example.com')
.then((res) => {
assert.strictEqual(res.status, 200);
assert.strictEqual(res.data, 'final');
});
});
});

@@ -113,0 +160,0 @@

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