-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: highIf it breaks the basic use of the productIf it breaks the basic use of the productsource: core:strapiSource is core/strapi packageSource is core/strapi packagestatus: confirmedConfirmed by a Strapi Team member or multiple community membersConfirmed by a Strapi Team member or multiple community members
Description
Setup
- Node.js version: 16.14.2
- NPM version: 8.13.2
- Strapi version: 4.4.4
- Database: postgres
- Operating system: MacOS Monterey 12.6
Describe the bug
After recently update from 4.4.3 to 4.4.4 responses with the following error while visiting localhost:1337 or any other related URL:
{
"data": null,
"error": {
"status": 500,
"name": "InternalServerError",
"message": "undefined is not a valid origin"
}
}I have a custom CORS policy in middleware.js (see "step to reproduce" for the code), which did worked with previous versions. After update to 4.4.4 it seems to be broken. Using standard CORS config as 'strapi::cors' fix the issue.
Steps to reproduce the behavior
- Update Strapi to 4.4.4
- Make sure to have custom CORS policy in
middleware.js, e.g.:
{
name: "strapi::cors",
config: {
enabled: true,
headers: "*",
origin: env.array("ALLOWED_ORIGINS_URL"), // for example: http://localhost:3000,http://localhost:1337
},
},Expected behavior
Strapi works normally without any errors. Admin panel can be visited.
swiiny
Metadata
Metadata
Assignees
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: highIf it breaks the basic use of the productIf it breaks the basic use of the productsource: core:strapiSource is core/strapi packageSource is core/strapi packagestatus: confirmedConfirmed by a Strapi Team member or multiple community membersConfirmed by a Strapi Team member or multiple community members