Fix CORS issue for anonymous user in multi-domain environment

Created on 5 August 2024, 9 months ago
Updated 19 August 2024, 8 months ago

Problem/Motivation

There's a CORS error (only for an anonymous user) when a site is available on multiple domains, like with lando:

When visiting the site on one domain chrome reports an error:

For authenticated user that link href is just a path without a domain name. Seems like an "external" URL is cached with one domain name, and then displayed on others.

Steps to reproduce

Proposed resolution

From D7 times the link href is generated as an absolute link in order to #2597173: Work out disabled clean URLs β†’ . Those conditions are not actual for modern Drupal, - clean URLs can't be disabled and the code, processing the list of CSS files, is different.

So generate the relative URL for the link href instead.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine pingwin4eg Zaporizhia πŸ‡ΊπŸ‡¦

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024