Changeset ff72ad2 for node_modules/axios/dist/node/axios.cjs
- Timestamp:
- 04/01/25 22:58:15 (2 months ago)
- Branches:
- master
- Children:
- 8ae59d6
- Parents:
- 3a74959
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
node_modules/axios/dist/node/axios.cjs
r3a74959 rff72ad2 1 / / Axios v1.7.9 Copyright (c) 2024 Matt Zabriskie and contributors1 /*! Axios v1.8.4 Copyright (c) 2025 Matt Zabriskie and contributors */ 2 2 'use strict'; 3 3 4 4 const FormData$1 = require('form-data'); 5 const crypto = require('crypto'); 5 6 const url = require('url'); 6 7 const proxyFromEnv = require('proxy-from-env'); … … 16 17 17 18 const FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData$1); 19 const crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto); 18 20 const url__default = /*#__PURE__*/_interopDefaultLegacy(url); 19 21 const proxyFromEnv__default = /*#__PURE__*/_interopDefaultLegacy(proxyFromEnv); … … 629 631 const toFiniteNumber = (value, defaultValue) => { 630 632 return value != null && Number.isFinite(value = +value) ? value : defaultValue; 631 };632 633 const ALPHA = 'abcdefghijklmnopqrstuvwxyz';634 635 const DIGIT = '0123456789';636 637 const ALPHABET = {638 DIGIT,639 ALPHA,640 ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT641 };642 643 const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {644 let str = '';645 const {length} = alphabet;646 while (size--) {647 str += alphabet[Math.random() * length|0];648 }649 650 return str;651 633 }; 652 634 … … 778 760 global: _global, 779 761 isContextDefined, 780 ALPHABET,781 generateString,782 762 isSpecCompliantForm, 783 763 toJSONObject, … … 1291 1271 const URLSearchParams = url__default["default"].URLSearchParams; 1292 1272 1273 const ALPHA = 'abcdefghijklmnopqrstuvwxyz'; 1274 1275 const DIGIT = '0123456789'; 1276 1277 const ALPHABET = { 1278 DIGIT, 1279 ALPHA, 1280 ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT 1281 }; 1282 1283 const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { 1284 let str = ''; 1285 const {length} = alphabet; 1286 const randomValues = new Uint32Array(size); 1287 crypto__default["default"].randomFillSync(randomValues); 1288 for (let i = 0; i < size; i++) { 1289 str += alphabet[randomValues[i] % length]; 1290 } 1291 1292 return str; 1293 }; 1294 1295 1293 1296 const platform$1 = { 1294 1297 isNode: true, … … 1298 1301 Blob: typeof Blob !== 'undefined' && Blob || null 1299 1302 }, 1303 ALPHABET, 1304 generateString, 1300 1305 protocols: [ 'http', 'https', 'file', 'data' ] 1301 1306 }; … … 2072 2077 * @returns {string} The combined full path 2073 2078 */ 2074 function buildFullPath(baseURL, requestedURL) { 2075 if (baseURL && !isAbsoluteURL(requestedURL)) { 2079 function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { 2080 let isRelativeUrl = !isAbsoluteURL(requestedURL); 2081 if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) { 2076 2082 return combineURLs(baseURL, requestedURL); 2077 2083 } … … 2079 2085 } 2080 2086 2081 const VERSION = "1. 7.9";2087 const VERSION = "1.8.4"; 2082 2088 2083 2089 function parseProtocol(url) { … … 2289 2295 const readBlob$1 = readBlob; 2290 2296 2291 const BOUNDARY_ALPHABET = utils$1.ALPHABET.ALPHA_DIGIT + '-_';2297 const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_'; 2292 2298 2293 2299 const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util__default["default"].TextEncoder(); … … 2349 2355 tag = 'form-data-boundary', 2350 2356 size = 25, 2351 boundary = tag + '-' + utils$1.generateString(size, BOUNDARY_ALPHABET)2357 boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET) 2352 2358 } = options || {}; 2353 2359 … … 2774 2780 2775 2781 // Parse url 2776 const fullPath = buildFullPath(config.baseURL, config.url );2782 const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); 2777 2783 const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined); 2778 2784 const protocol = parsed.protocol || supportedProtocols[0]; … … 3397 3403 newConfig.headers = headers = AxiosHeaders$1.from(headers); 3398 3404 3399 newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url ), config.params, config.paramsSerializer);3405 newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); 3400 3406 3401 3407 // HTTP basic authentication … … 4305 4311 } 4306 4312 4313 // Set config.allowAbsoluteUrls 4314 if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) { 4315 config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; 4316 } else { 4317 config.allowAbsoluteUrls = true; 4318 } 4319 4307 4320 validator.assertOptions(config, { 4308 4321 baseUrl: validators.spelling('baseURL'), … … 4400 4413 getUri(config) { 4401 4414 config = mergeConfig(this.defaults, config); 4402 const fullPath = buildFullPath(config.baseURL, config.url );4415 const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); 4403 4416 return buildURL(fullPath, config.params, config.paramsSerializer); 4404 4417 }
Note:
See TracChangeset
for help on using the changeset viewer.