How to fix error when using .woff and .woff2 extensions?
This article addresses an issue where Adobe Campaign Classic v7 (Release 7.2.2 - Build 9349) throws a CORS policy error when whitelisting .woff and .woff2 file extensions in a mid-instance.
Description description
Environment
Adobe Campaign Classic v7 (Release 7.2.2 - Build 9349)
Issue/Symptoms
After you whitelist .woff and .woff2 on a mid instance, and use these file extensions in a web app, the following error is thrown:
Access to font at 'https://mkt-instance.campaign.adobe.com/res/mid-instance/file_example.woff2'
from origin 'https://mkt-instance.campaign.adobe.com' has been blocked by
CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Steps to reproduce:
- Access the URL of the web app using .woff and .woff2 files.
- Open the browser console of your web browser, and notice the error for these files.
Resolution resolution
- Add
Access-Control-Allow-Origin,Access-Control-Allow-Headers, andAccess-Control-Allow-Methodsas responseHeader under the relay section of theserverConf.xml:
- Add
Access-Control-Allow-Origin,Access-Control-Allow-Headers, andAccess-Control-Allow-Methodsheaders onapache_neolane.confon both app containers:
- Once the two files have been saved, do a clean nlserver and apache restart on all containers of the instance.
Cause
The error is thrown because the mid instance was missing the configuration of Access-Control-Allow-Origin, Access-Control-Allow-Headers, and Access-Control-Allow-Methods headers on serverConf.xml and on apache_neolane.conf.
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f