mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-07-13 18:31:11 +03:00
Add CORS header to Element's map_style.json for Element Desktop
Element Desktop (Electron) loads the location-sharing map style from a `vector://vector` origin, so fetching map_style.json from the Element domain is a cross-origin request. Without an Access-Control-Allow-Origin header, the request is blocked and maps fail to load with "This homeserver is not configured correctly to display maps". Add a dedicated Traefik router for map_style.json that attaches an Access-Control-Allow-Origin header (configurable via matrix_client_element_location_sharing_map_style_access_control_allow_origin, defaulting to `*`). It is only defined when location sharing is enabled. Fixes #2291 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -346,6 +346,10 @@ matrix_client_element_configuration: "{{ matrix_client_element_configuration_def
|
||||
# How to host your own map tile server: https://matrix.org/docs/guides/map-tile-server
|
||||
matrix_client_element_location_sharing_enabled: false
|
||||
|
||||
# Controls the value of the `Access-Control-Allow-Origin` header attached to responses for `map_style.json`.
|
||||
# Element Desktop loads the map style from a `vector://vector` origin, so cross-origin access needs to be allowed.
|
||||
matrix_client_element_location_sharing_map_style_access_control_allow_origin: "*"
|
||||
|
||||
# Default Element location sharing map style configuration template which covers the generic use case.
|
||||
# You can customize it by controlling the various variables inside it.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user