mirror of
https://github.com/tenrok/axios.git
synced 2026-06-08 17:22:34 +03:00
* Adding tests to show config.url mutation Because config.url is modified while processing the request when the baseURL is set, it is impossible to perform a retry with the provided config object. Ref #1628 * Fixing url combining without modifying config.url As config.url is not modified anymore during the request processing. The request can safely be retried after it failed with the provided config. resolves #1628
This commit is contained in:
committed by
Felipe Martins
parent
98e4acd893
commit
6fe506fda2
@@ -646,6 +646,20 @@ describe('supports http with nodejs', function () {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should combine baseURL and url', function (done) {
|
||||
server = http.createServer(function (req, res) {
|
||||
res.end();
|
||||
}).listen(4444, function () {
|
||||
axios.get('/foo', {
|
||||
baseURL: 'http://localhost:4444/',
|
||||
}).then(function (res) {
|
||||
assert.equal(res.config.baseURL, 'http://localhost:4444/');
|
||||
assert.equal(res.config.url, '/foo');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user