The 'Access-Control-Allow-Origin' header that is not equal to the supplied origin when swiching between 2 domains access same static files

99 views Asked by At

in the context, I've an application that can access via 2 different URL like below

  • backoffice.*

  • backoffice-mfe.*

Everything will be fine if I stick and use only one domain in whole time, but the issue appear whenever I start to change between them

Let's say Im in backoffice.* and try to get enter the link of backoffice-mfe.* then it will happen

Access to fetch at 'https://storage.googleapis.com/import-map-deployer-staging/manabie/syllabus/20230821081002.0c032eb4/syllabus-init-module/index.js' from origin 'https://backoffice.staging.manabie.io' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'https://backoffice-mfe.staging.manabie.io' that is not equal to the supplied origin. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

enter image description here

I already tried to set the origin to *, and origin to access backoffice.* and backoffice-mfe.*.

Although, the Vary header already set Origin to don't get wrong cache for given URLs

But the issue still happens

Vary: Origin and Access-Control-Allow-Origin is backoffice-mfe

enter image description here

Has anyone encountered a similar situation? Thank you in advance for your help.

I'd like to fix above issue

0

There are 0 answers