Home

>

Tools

>

Strapi

>

Releases

>

4.22.1

Strapi Release: 4.22.1

Tag Name: v4.22.1

Release Date: 4/5/2024

Strapi LogoStrapi

Open-source headless CMS built with Node.js. Provides developers with complete freedom in choosing their favorite tools and frameworks for frontend development.

TL;DR

Strapi v4.22.1 is a patch release that reverts the upgrade of the @koa/cors package to version 5.0.0, which was causing issues with the CORS middleware. This reversion ensures that the CORS functionality works correctly for all Strapi applications.

Highlight of the Release

    • Reverted @koa/cors package from version 5.0.0 back to a previous compatible version
    • Fixed CORS middleware functionality that was broken in v4.22.0
    • Addressed issue #20033 related to CORS problems

Migration Guide

No migration steps are required for this update. Simply upgrade from v4.22.0 to v4.22.1 using your package manager:

npm install [email protected]
# or
yarn upgrade [email protected]

Upgrade Recommendations

This is a highly recommended upgrade for all users currently on v4.22.0, especially if you're experiencing any CORS-related issues with your API. The update is a simple dependency reversion with no breaking changes or configuration adjustments required.

If you haven't yet upgraded to v4.22.0, you may want to skip directly to v4.22.1 to avoid the CORS issues altogether.

Bug Fixes

CORS Middleware Fix

This release fixes an issue with the CORS middleware that was introduced in v4.22.0 when the @koa/cors package was upgraded to version 5.0.0. The upgrade caused the CORS middleware to malfunction, potentially preventing proper cross-origin requests to Strapi APIs.

The fix reverts the @koa/cors package to its previous compatible version, restoring proper CORS functionality for all Strapi applications.

Related issue: #20033

New Features

No new features were introduced in this patch release. This is strictly a bug fix release that reverts a problematic dependency upgrade.

Security Updates

No security fixes were included in this patch release.

Performance Improvements

No specific performance improvements were included in this patch release.

Impact Summary

This patch release addresses a critical compatibility issue with the CORS middleware in Strapi v4.22.0. The previous version included an upgrade to @koa/cors 5.0.0 which broke cross-origin request functionality, potentially affecting any Strapi application that serves APIs to clients on different domains.

By reverting this dependency upgrade, v4.22.1 ensures that CORS functionality works as expected, allowing proper cross-origin API access. This is particularly important for applications that serve as backends for separate frontend applications or third-party services.

The fix requires no configuration changes or special handling during the upgrade process, making it a straightforward update for all users.

Full Release Notes

Statistics:

File Changed48
Line Additions446
Line Deletions455
Line Changes901
Total Commits3

User Affected:

  • Developers who experienced CORS issues after upgrading to v4.22.0 will have those issues resolved
  • No action required to implement the fix other than upgrading to v4.22.1

Contributors:

derrickmehaffyalexandrebodin