mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Releasing 0.8.0
This commit is contained in:
Vendored
+45
-1
@@ -67,6 +67,8 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
var utils = __webpack_require__(3);
|
var utils = __webpack_require__(3);
|
||||||
var dispatchRequest = __webpack_require__(4);
|
var dispatchRequest = __webpack_require__(4);
|
||||||
var InterceptorManager = __webpack_require__(12);
|
var InterceptorManager = __webpack_require__(12);
|
||||||
|
var isAbsoluteURL = __webpack_require__(13);
|
||||||
|
var combineURLs = __webpack_require__(14);
|
||||||
|
|
||||||
function Axios (defaultConfig) {
|
function Axios (defaultConfig) {
|
||||||
this.defaultConfig = utils.merge({
|
this.defaultConfig = utils.merge({
|
||||||
@@ -92,6 +94,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
|
|
||||||
config = utils.merge(this.defaultConfig, { method: 'get' }, config);
|
config = utils.merge(this.defaultConfig, { method: 'get' }, config);
|
||||||
|
|
||||||
|
if (config.baseURL && !isAbsoluteURL(config.url)) {
|
||||||
|
config.url = combineURLs(config.baseURL, config.url);
|
||||||
|
}
|
||||||
|
|
||||||
// Don't allow overriding defaults.withCredentials
|
// Don't allow overriding defaults.withCredentials
|
||||||
config.withCredentials = config.withCredentials || defaults.withCredentials;
|
config.withCredentials = config.withCredentials || defaults.withCredentials;
|
||||||
|
|
||||||
@@ -129,7 +135,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
axios.all = function (promises) {
|
axios.all = function (promises) {
|
||||||
return Promise.all(promises);
|
return Promise.all(promises);
|
||||||
};
|
};
|
||||||
axios.spread = __webpack_require__(13);
|
axios.spread = __webpack_require__(15);
|
||||||
|
|
||||||
// Expose interceptors
|
// Expose interceptors
|
||||||
axios.interceptors = defaultInstance.interceptors;
|
axios.interceptors = defaultInstance.interceptors;
|
||||||
@@ -1027,6 +1033,44 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines whether the specified URL is absolute
|
||||||
|
*
|
||||||
|
* @param {string} url The URL to test
|
||||||
|
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
||||||
|
*/
|
||||||
|
module.exports = function isAbsoluteURL(url) {
|
||||||
|
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
||||||
|
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
||||||
|
// by any combination of letters, digits, plus, period, or hyphen.
|
||||||
|
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ },
|
||||||
|
/* 14 */
|
||||||
|
/***/ function(module, exports) {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new URL by combining the specified URLs
|
||||||
|
*
|
||||||
|
* @param {string} baseURL The base URL
|
||||||
|
* @param {string} relativeURL The relative URL
|
||||||
|
* @returns {string} The combined URL
|
||||||
|
*/
|
||||||
|
module.exports = function combineURLs(baseURL, relativeURL) {
|
||||||
|
return baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '');
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ },
|
||||||
|
/* 15 */
|
||||||
|
/***/ function(module, exports) {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Syntactic sugar for invoking a function and expanding an array for arguments.
|
* Syntactic sugar for invoking a function and expanding an array for arguments.
|
||||||
*
|
*
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user