@3846masa/axios-cookiejar-support
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -28,2 +28,6 @@ "use strict"; | ||
if (!local) { | ||
return $return(response); | ||
} | ||
if (local.jar && headers['set-cookie']) { | ||
@@ -69,7 +73,7 @@ setCookie = (0, _pify.default)(local.jar.setCookie.bind(local.jar)); | ||
if (local) { | ||
if (local.backupOptions) { | ||
Object.assign(config, local.backupOptions); | ||
} | ||
if (local && local.jar) { | ||
if (local.jar) { | ||
if (instance.defaults.jar && (!config.jar || config.jar === true)) { | ||
@@ -76,0 +80,0 @@ instance.defaults.jar = local.jar; |
@@ -14,3 +14,3 @@ { | ||
}, | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"main": "./lib/index", | ||
@@ -17,0 +17,0 @@ "directories": { |
@@ -69,2 +69,24 @@ 'use strict'; | ||
context('when response lacks COOKIEJAR_SUPPORT_LOCAL', () => { | ||
it('should receive response', done => { | ||
nock('http://example.com') | ||
.get('/') | ||
.reply(200); | ||
axios | ||
.get('http://example.com', { | ||
adapter: config => | ||
axios.defaults.adapter(config).then(response => { | ||
delete response.config[symbols.COOKIEJAR_SUPPORT_LOCAL]; | ||
return response; | ||
}), | ||
}) | ||
.then(res => { | ||
assert.strictEqual(res.status, 200); | ||
}) | ||
.then(done) | ||
.catch(done); | ||
}); | ||
}); | ||
context('when response has redirect', () => { | ||
@@ -71,0 +93,0 @@ let nockHost; |
Sorry, the diff of this file is not supported yet
128158
888