appium-mac2-driver 4.5.0 → 4.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/build/lib/session-claim-handler.d.ts.map +1 -1
  3. package/build/lib/session-claim-handler.js +1 -2
  4. package/build/lib/session-claim-handler.js.map +1 -1
  5. package/build/lib/wda-mac.d.ts +0 -1
  6. package/build/lib/wda-mac.d.ts.map +1 -1
  7. package/build/lib/wda-mac.js +1 -1
  8. package/lib/session-claim-handler.ts +1 -2
  9. package/lib/wda-mac.ts +1 -2
  10. package/node_modules/@appium/support/build/lib/npm.d.ts.map +1 -1
  11. package/node_modules/@appium/support/build/lib/npm.js +2 -1
  12. package/node_modules/@appium/support/build/lib/npm.js.map +1 -1
  13. package/node_modules/@appium/support/build/lib/util.d.ts.map +1 -1
  14. package/node_modules/@appium/support/build/lib/util.js +13 -1
  15. package/node_modules/@appium/support/build/lib/util.js.map +1 -1
  16. package/node_modules/@appium/support/build/lib/zip.d.ts +2 -1
  17. package/node_modules/@appium/support/build/lib/zip.d.ts.map +1 -1
  18. package/node_modules/@appium/support/build/lib/zip.js +193 -64
  19. package/node_modules/@appium/support/build/lib/zip.js.map +1 -1
  20. package/node_modules/@appium/support/lib/npm.ts +2 -1
  21. package/node_modules/@appium/support/lib/util.ts +13 -1
  22. package/node_modules/@appium/support/lib/zip.ts +231 -71
  23. package/node_modules/@appium/support/node_modules/axios/CHANGELOG.md +1934 -0
  24. package/node_modules/@appium/support/node_modules/axios/LICENSE +7 -0
  25. package/node_modules/@appium/support/node_modules/axios/MIGRATION_GUIDE.md +877 -0
  26. package/node_modules/@appium/support/node_modules/axios/README.md +2851 -0
  27. package/node_modules/@appium/support/node_modules/axios/dist/axios.js +5807 -0
  28. package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js +5 -0
  29. package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js.map +1 -0
  30. package/node_modules/@appium/support/node_modules/axios/dist/browser/axios.cjs +5829 -0
  31. package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.js +5850 -0
  32. package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js +3 -0
  33. package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js.map +1 -0
  34. package/node_modules/@appium/support/node_modules/axios/dist/node/axios.cjs +6808 -0
  35. package/node_modules/@appium/support/node_modules/axios/index.d.cts +766 -0
  36. package/node_modules/@appium/support/node_modules/axios/index.d.ts +787 -0
  37. package/node_modules/@appium/support/node_modules/axios/index.js +45 -0
  38. package/node_modules/@appium/support/node_modules/axios/lib/adapters/README.md +36 -0
  39. package/node_modules/@appium/support/node_modules/axios/lib/adapters/adapters.js +132 -0
  40. package/node_modules/@appium/support/node_modules/axios/lib/adapters/fetch.js +696 -0
  41. package/node_modules/@appium/support/node_modules/axios/lib/adapters/http.js +1490 -0
  42. package/node_modules/@appium/support/node_modules/axios/lib/adapters/xhr.js +277 -0
  43. package/node_modules/@appium/support/node_modules/axios/lib/axios.js +89 -0
  44. package/node_modules/@appium/support/node_modules/axios/lib/cancel/CancelToken.js +135 -0
  45. package/node_modules/@appium/support/node_modules/axios/lib/cancel/CanceledError.js +22 -0
  46. package/node_modules/@appium/support/node_modules/axios/lib/cancel/isCancel.js +5 -0
  47. package/node_modules/@appium/support/node_modules/axios/lib/core/Axios.js +306 -0
  48. package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosError.js +219 -0
  49. package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosHeaders.js +474 -0
  50. package/node_modules/@appium/support/node_modules/axios/lib/core/InterceptorManager.js +171 -0
  51. package/node_modules/@appium/support/node_modules/axios/lib/core/README.md +8 -0
  52. package/node_modules/@appium/support/node_modules/axios/lib/core/buildFullPath.js +76 -0
  53. package/node_modules/@appium/support/node_modules/axios/lib/core/dispatchRequest.js +95 -0
  54. package/node_modules/@appium/support/node_modules/axios/lib/core/mergeConfig.js +174 -0
  55. package/node_modules/@appium/support/node_modules/axios/lib/core/methodList.js +17 -0
  56. package/node_modules/@appium/support/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
  57. package/node_modules/@appium/support/node_modules/axios/lib/core/settle.js +27 -0
  58. package/node_modules/@appium/support/node_modules/axios/lib/core/transformData.js +28 -0
  59. package/node_modules/@appium/support/node_modules/axios/lib/defaults/index.js +178 -0
  60. package/node_modules/@appium/support/node_modules/axios/lib/defaults/transitional.js +10 -0
  61. package/node_modules/@appium/support/node_modules/axios/lib/env/README.md +3 -0
  62. package/node_modules/@appium/support/node_modules/axios/lib/env/classes/FormData.js +2 -0
  63. package/node_modules/@appium/support/node_modules/axios/lib/env/data.js +1 -0
  64. package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosTransformStream.js +156 -0
  65. package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +59 -0
  66. package/node_modules/@appium/support/node_modules/axios/lib/helpers/Http2Sessions.js +121 -0
  67. package/node_modules/@appium/support/node_modules/axios/lib/helpers/HttpStatusCode.js +88 -0
  68. package/node_modules/@appium/support/node_modules/axios/lib/helpers/README.md +7 -0
  69. package/node_modules/@appium/support/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +29 -0
  70. package/node_modules/@appium/support/node_modules/axios/lib/helpers/bind.js +14 -0
  71. package/node_modules/@appium/support/node_modules/axios/lib/helpers/buildURL.js +69 -0
  72. package/node_modules/@appium/support/node_modules/axios/lib/helpers/callbackify.js +18 -0
  73. package/node_modules/@appium/support/node_modules/axios/lib/helpers/combineURLs.js +23 -0
  74. package/node_modules/@appium/support/node_modules/axios/lib/helpers/composeSignals.js +68 -0
  75. package/node_modules/@appium/support/node_modules/axios/lib/helpers/cookies.js +64 -0
  76. package/node_modules/@appium/support/node_modules/axios/lib/helpers/deprecatedMethod.js +31 -0
  77. package/node_modules/@appium/support/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +166 -0
  78. package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToJSON.js +125 -0
  79. package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToStream.js +119 -0
  80. package/node_modules/@appium/support/node_modules/axios/lib/helpers/fromDataURI.js +69 -0
  81. package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAbsoluteURL.js +19 -0
  82. package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
  83. package/node_modules/@appium/support/node_modules/axios/lib/helpers/isURLSameOrigin.js +16 -0
  84. package/node_modules/@appium/support/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
  85. package/node_modules/@appium/support/node_modules/axios/lib/helpers/null.js +2 -0
  86. package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseHeaders.js +71 -0
  87. package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
  88. package/node_modules/@appium/support/node_modules/axios/lib/helpers/progressEventReducer.js +54 -0
  89. package/node_modules/@appium/support/node_modules/axios/lib/helpers/readBlob.js +15 -0
  90. package/node_modules/@appium/support/node_modules/axios/lib/helpers/resolveConfig.js +107 -0
  91. package/node_modules/@appium/support/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
  92. package/node_modules/@appium/support/node_modules/axios/lib/helpers/shouldBypassProxy.js +505 -0
  93. package/node_modules/@appium/support/node_modules/axios/lib/helpers/speedometer.js +55 -0
  94. package/node_modules/@appium/support/node_modules/axios/lib/helpers/spread.js +28 -0
  95. package/node_modules/@appium/support/node_modules/axios/lib/helpers/throttle.js +45 -0
  96. package/node_modules/@appium/support/node_modules/axios/lib/helpers/toFormData.js +279 -0
  97. package/node_modules/@appium/support/node_modules/axios/lib/helpers/toURLEncodedForm.js +19 -0
  98. package/node_modules/@appium/support/node_modules/axios/lib/helpers/trackStream.js +89 -0
  99. package/node_modules/@appium/support/node_modules/axios/lib/helpers/validator.js +112 -0
  100. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
  101. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
  102. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
  103. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/index.js +13 -0
  104. package/node_modules/@appium/support/node_modules/axios/lib/platform/common/utils.js +52 -0
  105. package/node_modules/@appium/support/node_modules/axios/lib/platform/index.js +7 -0
  106. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
  107. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
  108. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
  109. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/index.js +37 -0
  110. package/node_modules/@appium/support/node_modules/axios/lib/utils.js +1150 -0
  111. package/node_modules/@appium/support/node_modules/axios/package.json +203 -0
  112. package/node_modules/@appium/support/package.json +6 -6
  113. package/node_modules/@appium/types/build/lib/commands/basedriver.d.ts +6 -4
  114. package/node_modules/@appium/types/build/lib/commands/basedriver.d.ts.map +1 -1
  115. package/node_modules/@appium/types/lib/commands/basedriver.ts +4 -4
  116. package/node_modules/@appium/types/package.json +2 -2
  117. package/node_modules/appium-xcode/CHANGELOG.md +7 -0
  118. package/node_modules/appium-xcode/package.json +4 -4
  119. package/node_modules/asyncbox/README.md +43 -0
  120. package/node_modules/asyncbox/build/cjs/lib/asyncfilter.d.ts +9 -0
  121. package/node_modules/asyncbox/build/cjs/lib/asyncfilter.d.ts.map +1 -0
  122. package/node_modules/asyncbox/build/cjs/lib/asyncfilter.js +35 -0
  123. package/node_modules/asyncbox/build/cjs/lib/asyncfilter.js.map +1 -0
  124. package/node_modules/asyncbox/build/cjs/lib/asyncmap.d.ts +9 -0
  125. package/node_modules/asyncbox/build/cjs/lib/asyncmap.d.ts.map +1 -0
  126. package/node_modules/asyncbox/build/cjs/lib/asyncmap.js +23 -0
  127. package/node_modules/asyncbox/build/cjs/lib/asyncmap.js.map +1 -0
  128. package/node_modules/asyncbox/build/cjs/lib/errors.d.ts +9 -0
  129. package/node_modules/asyncbox/build/cjs/lib/errors.d.ts.map +1 -0
  130. package/node_modules/asyncbox/build/cjs/lib/errors.js +20 -0
  131. package/node_modules/asyncbox/build/cjs/lib/errors.js.map +1 -0
  132. package/node_modules/asyncbox/build/cjs/lib/index.d.ts +12 -0
  133. package/node_modules/asyncbox/build/cjs/lib/index.d.ts.map +1 -0
  134. package/node_modules/asyncbox/build/cjs/lib/index.js +24 -0
  135. package/node_modules/asyncbox/build/cjs/lib/index.js.map +1 -0
  136. package/node_modules/asyncbox/build/cjs/lib/limit-function.d.ts +3 -0
  137. package/node_modules/asyncbox/build/cjs/lib/limit-function.d.ts.map +1 -0
  138. package/node_modules/asyncbox/build/cjs/lib/limit-function.js +15 -0
  139. package/node_modules/asyncbox/build/cjs/lib/limit-function.js.map +1 -0
  140. package/node_modules/asyncbox/build/cjs/lib/lock.d.ts +74 -0
  141. package/node_modules/asyncbox/build/cjs/lib/lock.d.ts.map +1 -0
  142. package/node_modules/asyncbox/build/cjs/lib/lock.js +295 -0
  143. package/node_modules/asyncbox/build/cjs/lib/lock.js.map +1 -0
  144. package/node_modules/asyncbox/build/cjs/lib/long-sleep.d.ts +15 -0
  145. package/node_modules/asyncbox/build/cjs/lib/long-sleep.d.ts.map +1 -0
  146. package/node_modules/asyncbox/build/cjs/lib/long-sleep.js +36 -0
  147. package/node_modules/asyncbox/build/cjs/lib/long-sleep.js.map +1 -0
  148. package/node_modules/asyncbox/build/cjs/lib/retry.d.ts +17 -0
  149. package/node_modules/asyncbox/build/cjs/lib/retry.d.ts.map +1 -0
  150. package/node_modules/asyncbox/build/cjs/lib/retry.js +57 -0
  151. package/node_modules/asyncbox/build/cjs/lib/retry.js.map +1 -0
  152. package/node_modules/asyncbox/build/cjs/lib/sleep.d.ts +20 -0
  153. package/node_modules/asyncbox/build/cjs/lib/sleep.d.ts.map +1 -0
  154. package/node_modules/asyncbox/build/cjs/lib/sleep.js +61 -0
  155. package/node_modules/asyncbox/build/cjs/lib/sleep.js.map +1 -0
  156. package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts +18 -0
  157. package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts.map +1 -0
  158. package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js +51 -0
  159. package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js.map +1 -0
  160. package/node_modules/asyncbox/build/cjs/lib/with-timeout.d.ts +16 -0
  161. package/node_modules/asyncbox/build/cjs/lib/with-timeout.d.ts.map +1 -0
  162. package/node_modules/asyncbox/build/cjs/lib/with-timeout.js +45 -0
  163. package/node_modules/asyncbox/build/cjs/lib/with-timeout.js.map +1 -0
  164. package/node_modules/asyncbox/build/esm/lib/asyncfilter.d.ts +9 -0
  165. package/node_modules/asyncbox/build/esm/lib/asyncfilter.d.ts.map +1 -0
  166. package/node_modules/asyncbox/build/esm/lib/asyncfilter.js +32 -0
  167. package/node_modules/asyncbox/build/esm/lib/asyncfilter.js.map +1 -0
  168. package/node_modules/asyncbox/build/esm/lib/asyncmap.d.ts +9 -0
  169. package/node_modules/asyncbox/build/esm/lib/asyncmap.d.ts.map +1 -0
  170. package/node_modules/asyncbox/build/esm/lib/asyncmap.js +20 -0
  171. package/node_modules/asyncbox/build/esm/lib/asyncmap.js.map +1 -0
  172. package/node_modules/asyncbox/build/esm/lib/errors.d.ts +9 -0
  173. package/node_modules/asyncbox/build/esm/lib/errors.d.ts.map +1 -0
  174. package/node_modules/asyncbox/build/esm/lib/errors.js +15 -0
  175. package/node_modules/asyncbox/build/esm/lib/errors.js.map +1 -0
  176. package/node_modules/asyncbox/build/esm/lib/index.d.ts +12 -0
  177. package/node_modules/asyncbox/build/esm/lib/index.d.ts.map +1 -0
  178. package/node_modules/asyncbox/build/esm/lib/index.js +10 -0
  179. package/node_modules/asyncbox/build/esm/lib/index.js.map +1 -0
  180. package/node_modules/asyncbox/build/esm/lib/limit-function.d.ts +3 -0
  181. package/node_modules/asyncbox/build/esm/lib/limit-function.d.ts.map +1 -0
  182. package/node_modules/asyncbox/build/esm/lib/limit-function.js +12 -0
  183. package/node_modules/asyncbox/build/esm/lib/limit-function.js.map +1 -0
  184. package/node_modules/asyncbox/build/esm/lib/lock.d.ts +74 -0
  185. package/node_modules/asyncbox/build/esm/lib/lock.d.ts.map +1 -0
  186. package/node_modules/asyncbox/build/esm/lib/lock.js +291 -0
  187. package/node_modules/asyncbox/build/esm/lib/lock.js.map +1 -0
  188. package/node_modules/asyncbox/build/esm/lib/long-sleep.d.ts +15 -0
  189. package/node_modules/asyncbox/build/esm/lib/long-sleep.d.ts.map +1 -0
  190. package/node_modules/asyncbox/build/esm/lib/long-sleep.js +33 -0
  191. package/node_modules/asyncbox/build/esm/lib/long-sleep.js.map +1 -0
  192. package/node_modules/asyncbox/build/esm/lib/retry.d.ts +17 -0
  193. package/node_modules/asyncbox/build/esm/lib/retry.d.ts.map +1 -0
  194. package/node_modules/asyncbox/build/esm/lib/retry.js +53 -0
  195. package/node_modules/asyncbox/build/esm/lib/retry.js.map +1 -0
  196. package/node_modules/asyncbox/build/esm/lib/sleep.d.ts +20 -0
  197. package/node_modules/asyncbox/build/esm/lib/sleep.d.ts.map +1 -0
  198. package/node_modules/asyncbox/build/esm/lib/sleep.js +58 -0
  199. package/node_modules/asyncbox/build/esm/lib/sleep.js.map +1 -0
  200. package/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts +18 -0
  201. package/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts.map +1 -0
  202. package/node_modules/asyncbox/build/esm/lib/wait-for-condition.js +48 -0
  203. package/node_modules/asyncbox/build/esm/lib/wait-for-condition.js.map +1 -0
  204. package/node_modules/asyncbox/build/esm/lib/with-timeout.d.ts +16 -0
  205. package/node_modules/asyncbox/build/esm/lib/with-timeout.d.ts.map +1 -0
  206. package/node_modules/asyncbox/build/esm/lib/with-timeout.js +42 -0
  207. package/node_modules/asyncbox/build/esm/lib/with-timeout.js.map +1 -0
  208. package/node_modules/asyncbox/lib/asyncfilter.ts +38 -0
  209. package/node_modules/asyncbox/lib/asyncmap.ts +29 -0
  210. package/node_modules/asyncbox/lib/errors.ts +15 -0
  211. package/node_modules/asyncbox/lib/index.ts +21 -0
  212. package/node_modules/asyncbox/lib/limit-function.ts +18 -0
  213. package/node_modules/asyncbox/lib/lock.ts +360 -0
  214. package/node_modules/asyncbox/lib/long-sleep.ts +38 -0
  215. package/node_modules/asyncbox/lib/retry.ts +61 -0
  216. package/node_modules/asyncbox/lib/sleep.ts +79 -0
  217. package/node_modules/asyncbox/lib/wait-for-condition.ts +52 -0
  218. package/node_modules/asyncbox/lib/with-timeout.ts +43 -0
  219. package/node_modules/asyncbox/package.json +8 -8
  220. package/node_modules/axios/README.md +41 -106
  221. package/node_modules/axios/dist/axios.js +931 -278
  222. package/node_modules/axios/dist/axios.min.js +2 -2
  223. package/node_modules/axios/dist/axios.min.js.map +1 -1
  224. package/node_modules/axios/dist/browser/axios.cjs +948 -268
  225. package/node_modules/axios/dist/esm/axios.js +948 -268
  226. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  227. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  228. package/node_modules/axios/dist/node/axios.cjs +925 -242
  229. package/node_modules/axios/index.d.cts +20 -1
  230. package/node_modules/axios/index.d.ts +18 -1
  231. package/node_modules/axios/lib/adapters/fetch.js +73 -20
  232. package/node_modules/axios/lib/adapters/http.js +145 -26
  233. package/node_modules/axios/lib/adapters/xhr.js +120 -13
  234. package/node_modules/axios/lib/core/Axios.js +67 -12
  235. package/node_modules/axios/lib/core/AxiosError.js +59 -0
  236. package/node_modules/axios/lib/core/AxiosHeaders.js +17 -4
  237. package/node_modules/axios/lib/core/InterceptorManager.js +13 -2
  238. package/node_modules/axios/lib/core/assertParamsAcyclic.js +49 -0
  239. package/node_modules/axios/lib/core/createMultipartBody.js +37 -0
  240. package/node_modules/axios/lib/core/dispatchRequest.js +20 -0
  241. package/node_modules/axios/lib/core/mergeConfig.js +183 -120
  242. package/node_modules/axios/lib/defaults/transitional.js +1 -0
  243. package/node_modules/axios/lib/env/data.js +1 -1
  244. package/node_modules/axios/lib/helpers/AxiosTransformStream.js +11 -2
  245. package/node_modules/axios/lib/helpers/Http2Sessions.js +2 -1
  246. package/node_modules/axios/lib/helpers/composeSignals.js +6 -3
  247. package/node_modules/axios/lib/helpers/cookies.js +30 -6
  248. package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +34 -7
  249. package/node_modules/axios/lib/helpers/formDataToBlob.js +113 -0
  250. package/node_modules/axios/lib/helpers/formDataToJSON.js +25 -1
  251. package/node_modules/axios/lib/helpers/fromDataURI.js +8 -2
  252. package/node_modules/axios/lib/helpers/isURLSameOrigin.js +4 -9
  253. package/node_modules/axios/lib/helpers/parseHeaders.js +2 -1
  254. package/node_modules/axios/lib/helpers/parseProtocol.js +1 -1
  255. package/node_modules/axios/lib/helpers/resolveConfig.js +16 -3
  256. package/node_modules/axios/lib/helpers/shouldBypassProxy.js +16 -1
  257. package/node_modules/axios/lib/utils.js +61 -10
  258. package/node_modules/axios/package.json +1 -2
  259. package/node_modules/follow-redirects/README.md +27 -1
  260. package/node_modules/follow-redirects/index.js +1 -5
  261. package/node_modules/follow-redirects/package.json +1 -1
  262. package/node_modules/shell-quote/README.md +37 -4
  263. package/node_modules/shell-quote/package.json +10 -6
  264. package/node_modules/shell-quote/parse.d.ts +1 -1
  265. package/node_modules/shell-quote/parse.js +63 -11
  266. package/node_modules/shell-quote/quote.d.ts +2 -1
  267. package/node_modules/shell-quote/quote.js +23 -3
  268. package/node_modules/uuid/package.json +17 -17
  269. package/package.json +4 -6
  270. package/node_modules/async-lock/AUTHORS +0 -21
  271. package/node_modules/async-lock/History.md +0 -132
  272. package/node_modules/async-lock/LICENSE +0 -22
  273. package/node_modules/async-lock/README.md +0 -177
  274. package/node_modules/async-lock/index.js +0 -2
  275. package/node_modules/async-lock/lib/index.js +0 -312
  276. package/node_modules/async-lock/package.json +0 -48
  277. package/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts +0 -103
  278. package/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts.map +0 -1
  279. package/node_modules/asyncbox/build/cjs/lib/asyncbox.js +0 -311
  280. package/node_modules/asyncbox/build/cjs/lib/asyncbox.js.map +0 -1
  281. package/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts +0 -103
  282. package/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts.map +0 -1
  283. package/node_modules/asyncbox/build/esm/lib/asyncbox.js +0 -298
  284. package/node_modules/asyncbox/build/esm/lib/asyncbox.js.map +0 -1
  285. package/node_modules/asyncbox/lib/asyncbox.ts +0 -382
  286. package/node_modules/shell-quote/.nycrc +0 -14
  287. package/node_modules/shell-quote/eslint.config.mjs +0 -29
  288. package/node_modules/shell-quote/security.md +0 -11
  289. package/node_modules/shell-quote/test/comment.js +0 -16
  290. package/node_modules/shell-quote/test/env.js +0 -52
  291. package/node_modules/shell-quote/test/env_fn.js +0 -21
  292. package/node_modules/shell-quote/test/op.js +0 -102
  293. package/node_modules/shell-quote/test/parse.js +0 -149
  294. package/node_modules/shell-quote/test/quote.js +0 -145
  295. package/node_modules/shell-quote/test/set.js +0 -31
@@ -181,7 +181,7 @@ declare class CanceledError<T, D = any, P = any> extends AxiosError<T, D, P> {
181
181
 
182
182
  declare const axiosResponseDefault: unique symbol;
183
183
 
184
- type AxiosResponseDefault = typeof axiosResponseDefault;
184
+ type AxiosResponseDefault = axios.AxiosResponseDefault;
185
185
 
186
186
  type AxiosResponseResult<T, R, D, P> = R extends AxiosResponseDefault
187
187
  ? axios.AxiosResponse<T, D, {}, P>
@@ -331,6 +331,10 @@ declare enum HttpStatusCode {
331
331
  type InternalAxiosError<T = unknown, D = any, P = any> = AxiosError<T, D, P>;
332
332
 
333
333
  declare namespace axios {
334
+ interface AxiosResponseDefault {
335
+ readonly [axiosResponseDefault]: true;
336
+ }
337
+
334
338
  type AxiosHeaderParameters = Record<string, string>;
335
339
 
336
340
  type AxiosError<T = unknown, D = any, P = any> = InternalAxiosError<T, D, P>;
@@ -430,6 +434,8 @@ declare namespace axios {
430
434
  legacyInterceptorReqResOrdering?: boolean;
431
435
  advertiseZstdAcceptEncoding?: boolean;
432
436
  validateStatusUndefinedResolves?: boolean;
437
+ /** Opt in to UTF-8 Basic auth usernames in XHR/Fetch config resolution. Defaults to false. */
438
+ encodeBasicAuthUsername?: boolean;
433
439
  }
434
440
 
435
441
  interface GenericAbortSignal {
@@ -561,6 +567,14 @@ declare namespace axios {
561
567
  FormData?: new (...args: any[]) => object;
562
568
  fetch?: (input: URL | Request | string, init?: RequestInit) => Promise<Response>;
563
569
  Request?: new (input: URL | Request | string, init?: RequestInit) => Request;
570
+ /**
571
+ * Custom Response constructor for the fetch adapter.
572
+ * When response-body streaming is supported, must also accept
573
+ * `ReadableStream<Uint8Array>` bodies at runtime for `onDownloadProgress`,
574
+ * enabled `maxContentLength` limits, or cancellation/timeout tracking with
575
+ * `responseType: 'stream'` or `'response'`.
576
+ * The body parameter retains its legacy type for compatibility.
577
+ */
564
578
  Response?: new (
565
579
  body?: ArrayBuffer | ArrayBufferView | Blob | FormData | URLSearchParams | string | null,
566
580
  init?: ResponseInit
@@ -636,6 +650,11 @@ declare namespace axios {
636
650
  data: T;
637
651
  status: number;
638
652
  statusText: string;
653
+ /**
654
+ * Wall-clock milliseconds from adapter invocation to settlement, clamped at zero.
655
+ * Excludes interceptors and request/response transforms. Stream consumption is not included.
656
+ */
657
+ duration?: number;
639
658
  headers: (H & RawAxiosResponseHeaders) | AxiosResponseHeaders;
640
659
  config: InternalAxiosRequestConfig<D, P>;
641
660
  request?: any;
@@ -304,6 +304,8 @@ export interface TransitionalOptions {
304
304
  legacyInterceptorReqResOrdering?: boolean;
305
305
  advertiseZstdAcceptEncoding?: boolean;
306
306
  validateStatusUndefinedResolves?: boolean;
307
+ /** Opt in to UTF-8 Basic auth usernames in XHR/Fetch config resolution. Defaults to false. */
308
+ encodeBasicAuthUsername?: boolean;
307
309
  }
308
310
 
309
311
  export interface GenericAbortSignal {
@@ -444,6 +446,14 @@ export interface AxiosRequestConfig<D = any, P = any> {
444
446
  FormData?: new (...args: any[]) => object;
445
447
  fetch?: (input: URL | Request | string, init?: RequestInit) => Promise<Response>;
446
448
  Request?: new (input: URL | Request | string, init?: RequestInit) => Request;
449
+ /**
450
+ * Custom Response constructor for the fetch adapter.
451
+ * When response-body streaming is supported, must also accept
452
+ * `ReadableStream<Uint8Array>` bodies at runtime for `onDownloadProgress`,
453
+ * enabled `maxContentLength` limits, or cancellation/timeout tracking with
454
+ * `responseType: 'stream'` or `'response'`.
455
+ * The body parameter retains its legacy type for compatibility.
456
+ */
447
457
  Response?: new (
448
458
  body?: ArrayBuffer | ArrayBufferView | Blob | FormData | URLSearchParams | string | null,
449
459
  init?: ResponseInit
@@ -516,6 +526,11 @@ export interface AxiosResponse<T = any, D = any, H = {}, P = any> {
516
526
  data: T;
517
527
  status: number;
518
528
  statusText: string;
529
+ /**
530
+ * Wall-clock milliseconds from adapter invocation to settlement, clamped at zero.
531
+ * Excludes interceptors and request/response transforms. Stream consumption is not included.
532
+ */
533
+ duration?: number;
519
534
  headers: (H & RawAxiosResponseHeaders) | AxiosResponseHeaders;
520
535
  config: InternalAxiosRequestConfig<D, P>;
521
536
  request?: any;
@@ -571,7 +586,9 @@ export class CanceledError<T, D = any, P = any> extends AxiosError<T, D, P> {
571
586
 
572
587
  declare const axiosResponseDefault: unique symbol;
573
588
 
574
- type AxiosResponseDefault = typeof axiosResponseDefault;
589
+ export interface AxiosResponseDefault {
590
+ readonly [axiosResponseDefault]: true;
591
+ }
575
592
 
576
593
  type AxiosResponseResult<T, R, D, P> = R extends AxiosResponseDefault
577
594
  ? AxiosResponse<T, D, {}, P>
@@ -3,6 +3,7 @@ import utils from '../utils.js';
3
3
  import AxiosError from '../core/AxiosError.js';
4
4
  import composeSignals from '../helpers/composeSignals.js';
5
5
  import { trackStream } from '../helpers/trackStream.js';
6
+ import createMultipartBody from '../core/createMultipartBody.js';
6
7
  import AxiosHeaders from '../core/AxiosHeaders.js';
7
8
  import {
8
9
  progressEventReducer,
@@ -89,11 +90,13 @@ const factory = (env) => {
89
90
  {
90
91
  Request: globalObject.Request,
91
92
  Response: globalObject.Response,
93
+ Blob: globalObject.Blob,
92
94
  },
93
95
  env
94
96
  );
95
97
 
96
- const { fetch: envFetch, Request, Response } = env;
98
+ const envFetch = utils.hasOwnProp(env, 'fetch') ? env.fetch : undefined;
99
+ const { Request, Response, Blob } = env;
97
100
  const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
98
101
  const isRequestSupported = isFunction(Request);
99
102
  const isResponseSupported = isFunction(Response);
@@ -142,6 +145,20 @@ const factory = (env) => {
142
145
  isReadableStreamSupported &&
143
146
  test(() => utils.isReadableStream(new Response('').body));
144
147
 
148
+ // Some runtimes reject every explicit cache mode. Use own defaults for both
149
+ // probes so unrelated polluted options cannot affect cache-mode detection.
150
+ const requestDefaults = Object.assign(Object.create(null), DEFAULT_REQUEST_OPTIONS);
151
+
152
+ if (isRequestSupported && !test(() => new Request(platform.origin, requestDefaults))) {
153
+ delete requestDefaults.cache;
154
+
155
+ // Only omit cache when that makes Request construction succeed. Otherwise
156
+ // retain the explicit default that protects supporting runtimes from pollution.
157
+ if (!test(() => new Request(platform.origin, requestDefaults))) {
158
+ requestDefaults.cache = DEFAULT_REQUEST_OPTIONS.cache;
159
+ }
160
+ }
161
+
145
162
  const resolvers = {
146
163
  stream: supportsResponseStream && ((res) => res.body),
147
164
  };
@@ -175,14 +192,6 @@ const factory = (env) => {
175
192
  return body.size;
176
193
  }
177
194
 
178
- if (utils.isSpecCompliantForm(body)) {
179
- const _request = new Request(platform.origin, {
180
- method: 'POST',
181
- body,
182
- });
183
- return (await _request.arrayBuffer()).byteLength;
184
- }
185
-
186
195
  if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {
187
196
  return body.byteLength;
188
197
  }
@@ -245,11 +254,12 @@ const factory = (env) => {
245
254
 
246
255
  let requestContentLength;
247
256
 
248
- // AxiosError we raise while the request body is being streamed. Captured
257
+ // AxiosErrors we raise while request or response bodies are being streamed. Captured
249
258
  // by identity so the catch block can surface it directly, regardless of
250
259
  // how the runtime wraps the resulting fetch rejection (undici exposes it
251
260
  // as `err.cause`; some browsers drop the original error entirely).
252
261
  let pendingBodyError = null;
262
+ let pendingResponseError = null;
253
263
 
254
264
  const maxBodyLengthError = () =>
255
265
  new AxiosError(
@@ -273,8 +283,9 @@ const factory = (env) => {
273
283
  };
274
284
  }
275
285
 
286
+ let parsedURL;
276
287
  if (maybeWithAuthCredentials(url)) {
277
- const parsedURL = new URL(url, platform.origin);
288
+ parsedURL = new URL(url, platform.origin);
278
289
 
279
290
  if (!auth && (parsedURL.username || parsedURL.password)) {
280
291
  const urlUsername = decodeURIComponentSafe(parsedURL.username);
@@ -303,8 +314,8 @@ const factory = (env) => {
303
314
  // Enforce maxContentLength for data: URLs up-front so we never materialize
304
315
  // an oversized payload. The HTTP adapter applies the same check (see http.js
305
316
  // "if (protocol === 'data:')" branch).
306
- if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) {
307
- const estimated = estimateDataURLDecodedBytes(url);
317
+ if (hasMaxContentLength && parsedURL && parsedURL.protocol === 'data:') {
318
+ const estimated = estimateDataURLDecodedBytes(parsedURL.href);
308
319
  if (estimated > maxContentLength) {
309
320
  throw new AxiosError(
310
321
  'maxContentLength size of ' + maxContentLength + ' exceeded',
@@ -315,6 +326,38 @@ const factory = (env) => {
315
326
  }
316
327
  }
317
328
 
329
+ const formContentType =
330
+ utils.isSpecCompliantForm(data) && AxiosHeaders.from(own('headers')).getContentType();
331
+ let formBoundary;
332
+ if (
333
+ utils.isString(formContentType) &&
334
+ /^multipart\/form-data(?:\s*;|$)/i.test(formContentType.trim())
335
+ ) {
336
+ const parameters = AxiosHeaders.parseParameters(formContentType);
337
+ if (utils.hasOwnProp(parameters, 'boundary')) formBoundary = parameters.boundary;
338
+ }
339
+
340
+ if (
341
+ utils.isSpecCompliantForm(data) &&
342
+ method !== 'get' &&
343
+ method !== 'head' &&
344
+ (hasMaxBodyLength ||
345
+ (onUploadProgress && supportsRequestStream) ||
346
+ formBoundary !== undefined)
347
+ ) {
348
+ data = createMultipartBody(
349
+ data,
350
+ Blob,
351
+ hasMaxBodyLength ? maxBodyLength : Infinity,
352
+ maxBodyLengthError,
353
+ formBoundary
354
+ );
355
+ // Blob.type lowercases its value, including a case-sensitive boundary.
356
+ // Retain the caller's header when an explicit boundary was serialized.
357
+ headers.setContentType(formBoundary === undefined ? data.type : formContentType);
358
+ requestContentLength = data.size;
359
+ }
360
+
318
361
  // Enforce maxBodyLength against known-size bodies before dispatch using
319
362
  // the body's *actual* size — never a caller-declared Content-Length,
320
363
  // which could under-report to slip an oversized body past the check.
@@ -460,7 +503,7 @@ const factory = (env) => {
460
503
  });
461
504
 
462
505
  if (isRequestSupported) {
463
- utils.forEach(DEFAULT_REQUEST_OPTIONS, (value, key) => {
506
+ utils.forEach(requestDefaults, (value, key) => {
464
507
  if (resolvedOptions[key] === undefined) {
465
508
  resolvedOptions[key] = value;
466
509
  }
@@ -534,12 +577,12 @@ const factory = (env) => {
534
577
  if (hasMaxContentLength) {
535
578
  bytesRead = loadedBytes;
536
579
  if (bytesRead > maxContentLength) {
537
- throw new AxiosError(
580
+ throw (pendingResponseError = new AxiosError(
538
581
  'maxContentLength size of ' + maxContentLength + ' exceeded',
539
582
  AxiosError.ERR_BAD_RESPONSE,
540
583
  config,
541
584
  request
542
- );
585
+ ));
543
586
  }
544
587
  }
545
588
  onProgress && onProgress(loadedBytes);
@@ -625,7 +668,7 @@ const factory = (env) => {
625
668
  }
626
669
 
627
670
  // Surface a maxBodyLength violation we raised while the request body was
628
- // being streamed. Matching by identity (rather than reading
671
+ // being streamed. Keeping the original error (rather than reading
629
672
  // `err.cause.isAxiosError`) keeps the error deterministic across runtimes
630
673
  // and avoids both prototype-pollution reads and mis-attributing a foreign
631
674
  // AxiosError that merely happened to land in `err.cause`.
@@ -634,6 +677,10 @@ const factory = (env) => {
634
677
  throw pendingBodyError;
635
678
  }
636
679
 
680
+ if (pendingResponseError) {
681
+ throw pendingResponseError;
682
+ }
683
+
637
684
  // Re-throw AxiosErrors we raised synchronously (data: URL / content-length
638
685
  // pre-checks, response size enforcement) without re-wrapping them.
639
686
  if (err instanceof AxiosError) {
@@ -669,9 +716,15 @@ const factory = (env) => {
669
716
  const seedCache = new Map();
670
717
 
671
718
  export const getFetch = (config) => {
672
- let env = (config && config.env) || {};
673
- const { fetch, Request, Response } = env;
674
- const seeds = [Request, Response, fetch];
719
+ const env = Object.create(null);
720
+ const configuredEnv = config && utils.hasOwnProp(config, 'env') && config.env;
721
+ ['fetch', 'Request', 'Response', 'Blob'].forEach((key) => {
722
+ if (configuredEnv && utils.hasOwnProp(configuredEnv, key)) {
723
+ env[key] = configuredEnv[key];
724
+ }
725
+ });
726
+ const { fetch, Request, Response, Blob } = env;
727
+ const seeds = [Request, Response, fetch, Blob];
675
728
 
676
729
  let len = seeds.length,
677
730
  i = len,
@@ -28,6 +28,7 @@ import ZlibHeaderTransformStream from '../helpers/ZlibHeaderTransformStream.js';
28
28
  import Http2Sessions from '../helpers/Http2Sessions.js';
29
29
  import callbackify from '../helpers/callbackify.js';
30
30
  import shouldBypassProxy from '../helpers/shouldBypassProxy.js';
31
+ import bind from '../helpers/bind.js';
31
32
  import { toByteStringHeaderObject } from '../helpers/sanitizeHeaderValue.js';
32
33
  import {
33
34
  progressEventReducer,
@@ -87,6 +88,18 @@ const kAxiosInstalledTunnel = Symbol('axios.http.installedTunnel');
87
88
  // so unbounded growth is not a concern in practice.
88
89
  const tunnelingAgentCache = new Map();
89
90
  const tunnelingAgentCacheUser = new WeakMap();
91
+ const directAgents = new WeakMap();
92
+ const directAgentHooks = ['createConnection', 'getName'];
93
+ const nativeAgentPoolHooks = [
94
+ 'addRequest',
95
+ 'createSocket',
96
+ 'removeSocket',
97
+ 'keepSocketAlive',
98
+ 'reuseSocket',
99
+ '_getSession',
100
+ '_cacheSession',
101
+ '_evictSession',
102
+ ];
90
103
  // Minimum minor versions where Node's HTTP Agent supports native proxyEnv
91
104
  // handling. Checking the selected agent below also covers startup modes such
92
105
  // as NODE_OPTIONS=--use-env-proxy and --no-use-env-proxy precedence.
@@ -133,6 +146,83 @@ function getProxyEnvAgent(options, configHttpAgent, configHttpsAgent) {
133
146
  : configHttpAgent || http.globalAgent;
134
147
  }
135
148
 
149
+ function getDirectAgent(configuredAgent, transport) {
150
+ if (
151
+ !process.allowedNodeEnvironmentFlags ||
152
+ !process.allowedNodeEnvironmentFlags.has('--use-env-proxy')
153
+ ) {
154
+ return configuredAgent;
155
+ }
156
+
157
+ const agent = configuredAgent || transport.globalAgent;
158
+ const options = agent && agent.options;
159
+ if (
160
+ !(agent instanceof transport.Agent) ||
161
+ agent.protocol !== transport.globalAgent.protocol ||
162
+ !options ||
163
+ !utils.hasOwnProp(options, 'proxyEnv') ||
164
+ typeof options.proxyEnv !== 'object' ||
165
+ options.proxyEnv === null
166
+ ) {
167
+ return configuredAgent;
168
+ }
169
+
170
+ // These hooks own pool queues or TLS session state. Neither binding them to
171
+ // the source agent nor copying them without subclass state preserves their
172
+ // behavior on a separate direct pool.
173
+ for (const hook of nativeAgentPoolHooks) {
174
+ if (
175
+ utils.isFunction(transport.Agent.prototype[hook]) &&
176
+ agent[hook] !== transport.Agent.prototype[hook]
177
+ ) {
178
+ throw new AxiosError(
179
+ 'proxy: false cannot adapt an agent overriding ' +
180
+ hook +
181
+ '; use an agent constructed without proxyEnv',
182
+ AxiosError.ERR_BAD_OPTION_VALUE
183
+ );
184
+ }
185
+ }
186
+
187
+ // Node snapshots proxyEnv when constructing the agent. Keep this check
188
+ // conservative even when the caller later removes protocol-specific entries.
189
+ let direct = directAgents.get(agent);
190
+ if (!direct) {
191
+ direct = new transport.Agent({ ...options, proxyEnv: undefined });
192
+
193
+ // Agent.destroy() does not emit an event. Keep the associated pool under
194
+ // the configured agent's lifetime, including agents reused after destroy().
195
+ const destroy = agent.destroy;
196
+ agent.destroy = function destroyWithDirectAgent() {
197
+ try {
198
+ return destroy.apply(this, arguments);
199
+ } finally {
200
+ direct.destroy();
201
+ }
202
+ };
203
+ directAgents.set(agent, direct);
204
+ }
205
+
206
+ // Connections and pool keys do not own the direct pool's queues. Preserve
207
+ // their configured receiver and refresh hooks that change between requests.
208
+ for (const hook of directAgentHooks) {
209
+ direct[hook] =
210
+ agent[hook] === transport.Agent.prototype[hook]
211
+ ? transport.Agent.prototype[hook]
212
+ : bind(agent[hook], agent);
213
+ }
214
+ return direct;
215
+ }
216
+
217
+ function setDirectAgent(options, configHttpAgent, configHttpsAgent) {
218
+ const secure = isHttps.test(options.protocol);
219
+ const agent = getDirectAgent(secure ? configHttpsAgent : configHttpAgent, secure ? https : http);
220
+ options.agent = agent;
221
+ if (options.agents) {
222
+ options.agents[secure ? 'https' : 'http'] = agent;
223
+ }
224
+ }
225
+
136
226
  function getTunnelingAgent(agentOptions, userHttpsAgent) {
137
227
  const key =
138
228
  agentOptions.protocol +
@@ -148,22 +238,24 @@ function getTunnelingAgent(agentOptions, userHttpsAgent) {
148
238
  : tunnelingAgentCache;
149
239
  let agent = cache.get(key);
150
240
  if (agent) return agent;
151
- // Forward the user's TLS options (custom CA, rejectUnauthorized, client cert,
152
- // etc.) into the tunneling agent so they apply to the origin TLS upgrade
153
- // performed after CONNECT. Our proxy fields take precedence on conflict.
241
+ // Preserve per-request TLS options for the proxy connection, with our proxy
242
+ // fields taking precedence. Global-agent options belong only to the origin
243
+ // TLS upgrade in the callback below.
154
244
  const merged =
155
245
  userHttpsAgent && userHttpsAgent.options
156
246
  ? { ...userHttpsAgent.options, ...agentOptions }
157
247
  : agentOptions;
158
248
  agent = new HttpsProxyAgent(merged);
159
- if (userHttpsAgent && userHttpsAgent.options) {
160
- const originTLSOptions = { ...userHttpsAgent.options };
161
- const callback = agent.callback;
162
- agent.callback = function axiosTunnelingAgentCallback(req, opts) {
163
- // HttpsProxyAgent v5 reads callback opts for the post-CONNECT origin TLS upgrade.
164
- return callback.call(this, req, { ...originTLSOptions, ...opts });
165
- };
166
- }
249
+ const callback = agent.callback;
250
+ agent.callback = function axiosTunnelingAgentCallback(req, opts) {
251
+ // Without a proxy the origin TLS connection would be made by https.globalAgent,
252
+ // so its options have to reach the tunneled origin too. Resolved per request
253
+ // because the tunneling agent outlives any one of them.
254
+ const originTLSAgent = userHttpsAgent || https.globalAgent;
255
+ const originTLSOptions = originTLSAgent && originTLSAgent.options;
256
+ // HttpsProxyAgent v5 reads callback opts for the post-CONNECT origin TLS upgrade.
257
+ return callback.call(this, req, { ...originTLSOptions, ...opts });
258
+ };
167
259
  agent[kAxiosInstalledTunnel] = true;
168
260
  cache.set(key, agent);
169
261
  return agent;
@@ -206,6 +298,10 @@ const http2Sessions = new Http2Sessions();
206
298
  * @returns {Object<string, any>}
207
299
  */
208
300
  function dispatchBeforeRedirect(options, responseDetails, requestDetails) {
301
+ if (!isSameOriginRedirect(options, requestDetails)) {
302
+ stripMatchingHeaders(options.headers, new Set(['authorization', 'cookie']));
303
+ delete options.auth;
304
+ }
209
305
  if (options.beforeRedirects.proxy) {
210
306
  options.beforeRedirects.proxy(options);
211
307
  }
@@ -215,6 +311,9 @@ function dispatchBeforeRedirect(options, responseDetails, requestDetails) {
215
311
  if (options.beforeRedirects.sensitiveHeaders) {
216
312
  options.beforeRedirects.sensitiveHeaders(options, requestDetails);
217
313
  }
314
+ if (options.beforeRedirects.direct) {
315
+ options.beforeRedirects.direct(options);
316
+ }
218
317
  if (options.beforeRedirects.config) {
219
318
  options.beforeRedirects.config(options, responseDetails, requestDetails);
220
319
  }
@@ -292,6 +391,14 @@ function setProxy(
292
391
  if (isRedirect && options.agent && options.agent[kAxiosInstalledTunnel]) {
293
392
  options.agent = undefined;
294
393
  }
394
+ if (
395
+ isRedirect &&
396
+ options.agents &&
397
+ options.agents.https &&
398
+ options.agents.https[kAxiosInstalledTunnel]
399
+ ) {
400
+ options.agents.https = configHttpsAgent;
401
+ }
295
402
  if (proxy) {
296
403
  // Read proxy fields without traversing the prototype chain. URL instances expose
297
404
  // username/password/hostname/host/port/protocol via getters on URL.prototype (so
@@ -429,8 +536,7 @@ function setProxy(
429
536
  };
430
537
 
431
538
  return Boolean(
432
- proxy ||
433
- (configProxy !== false && allowEnvProxy && isNodeEnvProxyEnabled(proxyEnvAgent))
539
+ proxy || (configProxy !== false && allowEnvProxy && isNodeEnvProxyEnabled(proxyEnvAgent))
434
540
  );
435
541
  }
436
542
 
@@ -580,9 +686,9 @@ export default isHttpAdapterSupported &&
580
686
  if (httpVersion === undefined) httpVersion = 1;
581
687
  const rawHttpVersion = httpVersion;
582
688
  let http2Options = own('http2Options');
689
+ const configProxy = own('proxy');
583
690
  const httpAgent = own('httpAgent');
584
691
  const httpsAgent = own('httpsAgent');
585
- const configProxy = own('proxy');
586
692
  const responseType = own('responseType');
587
693
  const responseEncoding = own('responseEncoding');
588
694
  const socketPath = own('socketPath');
@@ -761,6 +867,20 @@ export default isHttpAdapterSupported &&
761
867
  throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);
762
868
  }
763
869
 
870
+ // Check bytes before converting the result to text or a stream.
871
+ if (
872
+ maxContentLength > -1 &&
873
+ (responseType === 'blob' ? convertedData.size : convertedData.length) > maxContentLength
874
+ ) {
875
+ return reject(
876
+ new AxiosError(
877
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
878
+ AxiosError.ERR_BAD_RESPONSE,
879
+ config
880
+ )
881
+ );
882
+ }
883
+
764
884
  if (responseType === 'text') {
765
885
  convertedData = convertedData.toString(responseEncoding);
766
886
 
@@ -1020,15 +1140,15 @@ export default isHttpAdapterSupported &&
1020
1140
  }
1021
1141
  let transport;
1022
1142
  let isNativeTransport = false;
1023
- // True only for the follow-redirects transport, which applies
1024
- // options.maxBodyLength itself. Every other transport (http2, native
1025
- // http/https, a user-supplied custom transport) needs the explicit
1026
- // byte-counting pipeline below to enforce maxBodyLength on streamed uploads.
1027
- let transportEnforcesMaxBodyLength = false;
1028
1143
  const isHttpsRequest = isHttps.test(options.protocol);
1029
1144
  // Don't clobber a CONNECT-tunneling agent installed by setProxy() for an
1030
1145
  // HTTPS target.
1031
- if (options.agent == null) {
1146
+ if (!isHttp2 && configProxy === false) {
1147
+ setDirectAgent(options, httpAgent, httpsAgent);
1148
+ options.beforeRedirects.direct = (redirectOptions) => {
1149
+ setDirectAgent(redirectOptions, httpAgent, httpsAgent);
1150
+ };
1151
+ } else if (options.agent == null) {
1032
1152
  options.agent = isHttpsRequest ? httpsAgent : httpAgent;
1033
1153
  }
1034
1154
 
@@ -1052,7 +1172,6 @@ export default isHttpAdapterSupported &&
1052
1172
  transport = isHttpsRequest ? https : http;
1053
1173
  isNativeTransport = true;
1054
1174
  } else {
1055
- transportEnforcesMaxBodyLength = true;
1056
1175
  options.sensitiveHeaders = [];
1057
1176
  if (maxRedirects) {
1058
1177
  options.maxRedirects = maxRedirects;
@@ -1442,12 +1561,10 @@ export default isHttpAdapterSupported &&
1442
1561
  }
1443
1562
  });
1444
1563
 
1445
- // Enforce maxBodyLength for streamed uploads on every transport that
1446
- // does not apply options.maxBodyLength itself (native http/https, http2,
1447
- // and user-supplied custom transports). The follow-redirects transport
1448
- // enforces it on the redirected HTTP/1 path.
1564
+ // Transform decodes string chunks to Buffers before counting, so every
1565
+ // transport receives at most maxBodyLength encoded bytes.
1449
1566
  let uploadStream = data;
1450
- if (maxBodyLength > -1 && !transportEnforcesMaxBodyLength) {
1567
+ if (maxBodyLength > -1) {
1451
1568
  const limit = maxBodyLength;
1452
1569
  let bytesSent = 0;
1453
1570
  uploadStream = stream.pipeline(
@@ -1486,5 +1603,7 @@ export default isHttpAdapterSupported &&
1486
1603
  };
1487
1604
 
1488
1605
  export const __setProxy = setProxy;
1606
+ export const __getDirectAgent = getDirectAgent;
1607
+ export const __isNodeNativeEnvProxySupported = isNodeNativeEnvProxySupported;
1489
1608
  export const __isNodeEnvProxyEnabled = isNodeEnvProxyEnabled;
1490
1609
  export const __isSameOriginRedirect = isSameOriginRedirect;