CORS Access-Control-Allow-Origin never showing up
-
WordPress 6.1.1, multisite, locally-hosted
I am trying to get something called the Universal Viewer (https://universalviewer.io/) to read an IIIF manifest from our repository (https://digital.library.jhu.edu/node/15919/manifest) and display the items in the manifest on screen, embedded in a WordPress page.
Here is my code, just plopped down on a regular ol WordPress page:
<iframe src="https://1p175.csb.app/uv.html#?manifest=https://digital.library.jhu.edu/node/15919/manifest" allowfullscreen="" width="560" height="420" frameborder="0"></iframe>
But that’s not my problem! My problem is that I keep getting the CORS Missing Allow Origin error when it’s making the call out to grab the manifest from the remote server.
I’ve tried the .htaccess method for setting the Access-Control-Allow-Origin header directive, but no joy.
And here is what I’ve just now put in my local functions.php file, yet still no joy:
function add_cors_http_header(){ header("Access-Control-Allow-Origin: *"); } add_action('init','add_cors_http_header');
I go to take a peek at my headers and never see the Access-Control-Allow-Origin directive at all.
How can I force this header directive to show up in WordPress?
MUCH appreciated!
Mark
- The topic ‘CORS Access-Control-Allow-Origin never showing up’ is closed to new replies.