Skip to content

Bump axios from 1.16.1 to 1.22.0 - #308

Open
dependabot[bot] wants to merge 1 commit into
masterfrom
dependabot/npm_and_yarn/axios-1.22.0
Open

dependabot[bot] wants to merge 1 commit into
masterfrom
dependabot/npm_and_yarn/axios-1.22.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Dec 4, 2026

Copy link
Copy Markdown
Contributor

Bumps axios from 1.16.1 to 1.22.0.

Release notes

Sourced from axios's releases.

v1.22.0 (December 2, 2026)

This release fixes several request-validation and adapter edge cases (nullish URLs, negative timeouts, fetch stream cleanup), ports five recent v0.x fixes to v1.x, removes proxy-from-env as a runtime dependency, and includes documentation updates and routine dependency bumps.

🐛 Bug Fixes

  • Nullish Request URL: Built-in adapters now reject a request whose url is null or undefined with AxiosError / ERR_INVALID_URL before anything is sent. Previously axios.get(null, { params }) built a query-only URL that browsers resolved against the current page, XHR requested ./null, and the Node HTTP adapter threw a native TypeError. axios.getUri() now applies the same check and throws for configs the request would reject. A baseURL, a socketPath, a custom adapter, or an empty-string URL behave as before. (#11237, #11453)
  • Node HTTP Adapter, Negative Timeouts: A negative timeout (including fractional values such as -0.5) now fails as a standard timeout error (ECONNABORTED, or ETIMEDOUT with clarifyTimeoutError) before a connection is opened. Previously it could throw an uncaught ERR_OUT_OF_RANGE that crashed the process. The timeout is converted once, and a value that overflows to Infinity now rejects with ERR_BAD_OPTION_VALUE. (#11246)
  • Fetch Adapter, Stream Cleanup: Size-limit errors (maxBodyLength / maxContentLength) now cancel the source stream instead of leaving it open until garbage collection. The response-stream capability probe also cancels its throwaway body, which removes async-leak reports on Node.js 22 and older (for example from Vitest's --detect-async-leaks). (#11239, #11241)
  • Header Encoding Shortcuts: setContentEncoding, getContentEncoding, and hasContentEncoding now exist at runtime, as already documented and typed. The existing Accept-Encoding shortcuts are now declared in index.d.ts and index.d.cts. TypeScript users may need to adjust code that relied on the old, incorrect getContentEncoding() return type. (#11436)
  • Ported v0.x Fixes: Five fixes from v0.x are now in v1.x. Interceptor synchronous / runWhen options inherited only from Object.prototype are ignored. A slash-only baseURL (such as '/') always gives a root path on the current origin. Proxy environment lookup ignores names inherited from Object.prototype. With allowedSocketPaths set, the adapter connects to the same normalized socketPath it checked. follow-redirects gets explicit values for the redirect options it reads. The proxy lookup now lives in lib/helpers/proxyFromEnv.js, so proxy-from-env is no longer a runtime dependency. (#11517)

🔧 Maintenance & Chores

  • Documentation: Explained which timeout error code each adapter reports (fetch always uses ETIMEDOUT) and what fetch adapter progress support depends on. Added vlt to the install instructions, added @hyper-fetch/axios to ECOSYSTEM.md, removed SAP from the README sponsors, and pointed the MDN CORS link to the canonical English URL. (#11507, #11504, #11500, #11488, #11478)
  • Contributor Guidance: In AGENTS.md, the validator rule now covers only option type and shape checks in Axios#request. Checks that need the final config or the selected adapter belong on the request path. (#11439)
  • Dependencies: Bumped the runtime dependency follow-redirects to 1.16.3. Updated vitest, @vitest/browser, @vitest/browser-playwright, eslint, globals, rollup, @babel/core, @babel/preset-env, playwright, prettier, and lint-staged in development dependencies, plus zizmorcore/zizmor-action and peter-evans/create-pull-request in GitHub Actions. (#11467, #11437, #11438, #11469, #11468, #11502, #11503)
  • Release Preparation: Bumped the version metadata for 1.22.0. (#11520)

🌟 New Contributors

We are thrilled to welcome our new contributors. Thank you for helping improve axios:

Full Changelog

v1.21.1 — November 9, 2026

This release raises the minimum follow-redirects version to fix a published CVE, fixes a Next.js prerendering failure caused by the response duration timer, corrects the getAdapter typings, and includes documentation corrections, new test coverage, CI runner changes and dependency updates.

🔒 Security Fixes

  • follow-redirects: Raised the follow-redirects range from ^1.16.0 to ^1.16.2 to fix CVE-2026-116689 (GHSA-mrwp-f3q8-3g9p). In the vulnerable versions, sensitiveHeaders arrays from another realm were ignored and custom credentials could follow redirects. Only the Node.js HTTP adapter is affected, and there are no API changes. (#11410)

🐛 Bug Fixes

  • Response Duration: dispatchRequest now measures response.duration with performance.now() and uses Date.now() only when performance.now() isn't available. In v1.21.0, any axios request from a Server Component failed Next.js production builds with Cache Components (cacheComponents: true), because Next.js rejects Date.now() while prerendering. The duration is still a whole number of milliseconds, and system clock changes no longer affect it. (#11411)
  • TypeScript: getAdapter now accepts an optional config?: AxiosRequestConfig in index.d.ts and index.d.cts, matching what it does at runtime. You can now call getAdapter('fetch', { env: { fetch: myFetch } }) without a cast. (#11404)

🔧 Maintenance & Chores

... (truncated)

Changelog

Sourced from axios's changelog.

Changelog

v1.21.0 — October 21, 2026

This release adds response timing and opt-in UTF-8 Basic authentication, improves request handling across runtimes, and changes how header defaults are recognized.

⚠️ Breaking Changes & Deprecations

  • Header Defaults: Only plain objects, null-prototype maps, and compatible AxiosHeaders instances are treated as common or method-specific defaults; literal headers such as Link are now preserved. Applications using custom class instances as defaults must convert them to plain maps, for example { post: { ...customDefaults } }, or compatible AxiosHeaders. Otherwise, those instances become literal header values, including on requests using other methods. (#11156)

🚀 New Features

  • Response Timing: Added response.duration, in milliseconds, including on error.response when present. Timing measures adapter execution and excludes interceptors and transforms; streamed responses stop timing when the stream becomes available. Axios replaces any existing duration value supplied by a custom adapter. (#11214)
  • UTF-8 Basic Authentication: Added transitional.encodeBasicAuthUsername: true to support Unicode usernames in XHR and Fetch requests. The option defaults to false, preserving existing authentication behavior; applications opting in should supply the original Unicode username and remove manual pre-encoding workarounds. (#11159)

🐛 Bug Fixes

  • Fetch Compatibility: Restored requests in runtimes such as Cloudflare Workers that reject the implicit cache: 'default', while preserving explicit caller settings. Response-size failures now retain their original ERR_BAD_RESPONSE and request context when runtime wrappers replace the underlying stream error. (#11194, #11179)
  • Runtime Consistency: Aligned encoded-byte size accounting, multipart uploads, proxy routing, same-origin resolution, parameter merging, and form serialization across adapters. Circular parameters now reject with ERR_BAD_OPTION_VALUE, and sparse or non-index numeric form fields serialize as keyed objects. With proxy: false, native proxyEnv agents using unsupported pool-management or TLS-session lifecycle overrides now reject with ERR_BAD_OPTION_VALUE; construct those agents without proxyEnv. (#11242)
  • Header Handling: Preserved headers named __proto__ using safe casing without changing the AxiosHeaders instance prototype. Function matchers in has(), delete(), and clear() now receive the headers instance as this, matching their declared contract. (#11134, #11216)
  • URL and Data URL Parsing: Accepted case-insensitive supported URL schemes and Base64 markers, and corrected decoding of percent-encoded Base64 data URLs. Node data URL allocation estimates remain aligned with decoding so configured size limits apply before allocation. (#11138, #11163, #11294)
  • Error Diagnostics: Preserved short reconstructed request stacks and appended wrapped error stacks under Caused by: so tooling that reads only error.stack retains the original failure context. (#11132, #11142)
  • Interceptor Removal: Restored removal through canonical numeric-string interceptor IDs, including after registry compaction. (#11139)
  • Proxy TLS: HTTPS CONNECT tunnels now apply current origin TLS options from an explicit httpsAgent, or from https.globalAgent when no explicit agent is supplied. This preserves process-wide custom CA settings through proxy tunnels. (#11178)
  • XHR Lifecycle: Used asynchronous Cookie Store reads for XSRF tokens where supported, preserving cookie fallback, timeout accounting, and cancellation. Upload and download progress listeners are now removed on completion, failure, timeout, and cancellation. (#11166, #11225)
  • HTTP/2 Sessions: Stopped reusing sessions immediately after GOAWAY and prevented draining sessions from scheduling idle timers that could delay process exit. (#11210)
  • TypeScript Declarations: Exposed the response-default marker as a public type to resolve TS2527 when consumers emit declarations involving unresolved response generics, covering both ESM and CommonJS. (#11125)

🔧 Maintenance & Chores

  • Configuration Performance: Reduced request configuration merge overhead, particularly for requests with many headers, while preserving merge semantics and prototype-pollution guards. (#11208)
  • Same-Origin Checks: Removed obsolete Internet Explorer detection without changing origin decisions in supported environments. (#11174)
  • Dependencies: Updated follow-redirects to 1.16.1 and refreshed development, documentation, test, and GitHub Actions dependencies. Removed unused dayjs from the docs package, root chalk, and chai from CJS module tests. (#11169, #11188, #11189, #11195, #11212, #11213, #11218, #11220, #11221, #11230, #11234, #11244, #11245, #11266, #11267, #11268, #11269, #11270, #11271, #11272, #11298, #11302, #11303, #11304, #11305, #11306, #11313, #11321, #11322, #11323, #11342)
  • Documentation: Fixed interceptor test links, updated README CDN examples to the published 1.20.0 bundle, and corrected guidance on interceptor options and request lifecycle ordering. (#11228, #11149, #11335)
  • Contributor Workflow: Consolidated agent instructions in AGENTS.md, standardized PR labels, required prerelease notes and validation evidence, and clarified that npm test requires installed Playwright browsers. (#11238, #11273, #11223, #11284)
  • Sponsors and Support: Added HeroDevs, Code for Japan, and Sweepico sponsor listings, refreshed sponsor data, and documented extended security support for Axios v0. (#11222, #11249, #11252, #11341)
  • Proxy Regression Coverage: Added a long dotted request-hostname test for NO_PROXY handling, extending coverage of an existing denial-of-service fix. (#11235)
  • Release Preparation: Updated package version metadata for 1.21.0. (#11346)

🌟 New Contributors

Welcome to our 24 new contributors. Thank you for helping improve Axios:

... (truncated)

Commits
  • c3ce6ee chore(release): prepare release 1.22.0 (#11520)
  • 7c281d8 fix: port recent v0.x fixes to v1.x (#11517)
  • a138304 docs: correct Russian locale MDN CORS guide link to canonical URL (#11478)
  • b482ab8 docs: clarify timeout error codes by adapter (#11507)
  • 3076107 docs: add vlt to install instructions (#11504)
  • 71c87d5 docs: remove SAP from README sponsors (#11488)
  • a35e6f4 chore(deps-dev): bump the development_dependencies group with 6 updates (#11503)
  • adad57f chore(deps): bump peter-evans/create-pull-request from 8.1.2 to 8.1.3 in the ...
  • 60d7296 docs: add @​hyper-fetch/axios to ECOSYSTEM.md (#11500)
  • 9f0f4dd chore(deps): bump follow-redirects from 1.16.2 to 1.16.3 in the production_de...
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    You can disable automated security fix PRs for this repo from the Security Alerts page.

Bumps [axios](https://github.com/axios/axios) from 1.16.1 to 1.22.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.16.1...v1.22.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.22.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants