2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-11 18:02:32 +03:00

chore(release): v1.6.6 (#6199)

Co-authored-by: DigitalBrainJS <DigitalBrainJS@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2024-01-25 01:11:30 +02:00
committed by GitHub
parent a1938ff073
commit 104aa3f65d
17 changed files with 466 additions and 27 deletions
+26 -5
View File
@@ -1,4 +1,4 @@
// Axios v1.6.5 Copyright (c) 2024 Matt Zabriskie and contributors
// Axios v1.6.6 Copyright (c) 2024 Matt Zabriskie and contributors
'use strict';
const FormData$1 = require('form-data');
@@ -2022,7 +2022,7 @@ function buildFullPath(baseURL, requestedURL) {
return requestedURL;
}
const VERSION = "1.6.5";
const VERSION = "1.6.6";
function parseProtocol(url) {
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -2535,12 +2535,12 @@ const supportedProtocols = platform.protocols.map(protocol => {
*
* @returns {Object<string, any>}
*/
function dispatchBeforeRedirect(options) {
function dispatchBeforeRedirect(options, responseDetails) {
if (options.beforeRedirects.proxy) {
options.beforeRedirects.proxy(options);
}
if (options.beforeRedirects.config) {
options.beforeRedirects.config(options);
options.beforeRedirects.config(options, responseDetails);
}
}
@@ -3870,7 +3870,28 @@ class Axios {
*
* @returns {Promise} The Promise to be fulfilled
*/
request(configOrUrl, config) {
async request(configOrUrl, config) {
try {
return await this._request(configOrUrl, config);
} catch (err) {
const dummy = {};
if (Error.captureStackTrace) {
Error.captureStackTrace(dummy);
} else {
dummy.stack = new Error().stack;
}
// slice off the Error: ... line
dummy.stack = dummy.stack.replace(/^.+\n/, '');
// match without the 2 top stack lines
if (!err.stack.endsWith(dummy.stack.replace(/^.+\n.+\n/, ''))) {
err.stack += '\n' + dummy.stack;
}
throw err;
}
}
_request(configOrUrl, config) {
/*eslint no-param-reassign:0*/
// Allow for axios('example/url'[, config]) a la fetch API
if (typeof configOrUrl === 'string') {
+1 -1
View File
File diff suppressed because one or more lines are too long