SXA Open Graph tags does not work with enabled CDN for the Sitecore Media Library


Description

When using Sitecore Experience Accelerator (SXA) and adding custom metadata for an item through Open Graph meta tags, they might have an incorrect format. The issue occurs with the Content Delivery Network (CDN) configuration setting enabled. The expected value is:

https://{CDN_media_link}
For example, https://cdnwebsite.website.com/-/media/project/tenant/site/image.png?rev=somevalue

the actual value is:

https://{targetHostName}{relative media link}
https://site.website.comhttps://cdnwebsite.website.com/-/media/project/tenant/site/image.png?rev=somevalue

Solution

To resolve the issue, consider the following options: