mirror of
https://github.com/tenrok/axios.git
synced 2026-06-05 16:42:32 +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
@@ -4,8 +4,6 @@ var utils = require('./../utils');
|
||||
var transformData = require('./transformData');
|
||||
var isCancel = require('../cancel/isCancel');
|
||||
var defaults = require('../defaults');
|
||||
var isAbsoluteURL = require('./../helpers/isAbsoluteURL');
|
||||
var combineURLs = require('./../helpers/combineURLs');
|
||||
|
||||
/**
|
||||
* Throws a `Cancel` if cancellation has been requested.
|
||||
@@ -25,11 +23,6 @@ function throwIfCancellationRequested(config) {
|
||||
module.exports = function dispatchRequest(config) {
|
||||
throwIfCancellationRequested(config);
|
||||
|
||||
// Support baseURL config
|
||||
if (config.baseURL && !isAbsoluteURL(config.url)) {
|
||||
config.url = combineURLs(config.baseURL, config.url);
|
||||
}
|
||||
|
||||
// Ensure headers exist
|
||||
config.headers = config.headers || {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user