Skip to content

CORS error in admin product edit page with product images #39974

Open
@ioweb-gr

Description

@ioweb-gr

Preconditions and environment

  • 2.4.6-p10
  • At least two different domains

Steps to reproduce

  1. Setup a multi-website installation
  2. Website 1 at example.com
  3. Website 2 at example.net
  4. Admin page is working at example.com
  5. Visit the catalog product edit page at example.com/admin
  6. Switch to the second website store view from the store view switcher
  7. Navigate to the product images.
  8. The URL loaded is example.com/media/catalog/*****

Due to CORS the images are failing to load

Expected result

The images load fine for all domains that reside in the same installation

Actual result

The images are broken and multiple CORS related errors appear for img-src

Image

Additional information

I tried in a module's csp_whitelist.xml to add the following

<policy id="img-src">
    <values>
        <value id="img_src_example_com" type="host">example.com</value>
        <value id="img_src_example_net" type="host">example.net</value>
        <value id="img_src_example_org" type="host">example.org</value>
        <value id="img_src_example_shop" type="host">example.shop</value>
        <value id="img_src_example_store" type="host">example.store</value>
        <value id="img_src_example_online" type="host">example.online</value>
    </values>
</policy>

And I got an error loading the website

https://example.com/admin_custom/catalog/product/edit/key/********/id/123456/store/1/ might have a temporary problem or it could have moved.

Error code: 500 Internal Server Error

The site could be temporarily unavailable or too busy. Try again in a few moments.

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Labels

Issue: needs updateAdditional information is require, waiting for responseReported on 2.4.6-p10Indicates original Magento version for the Issue report.

Type

No type

Projects

Status

Needs Update

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions