Sign in to follow this  
fausto94

CORS Requests

Recommended Posts

Hello,

I'm trying to perform CORS requests but everytime I try I face this error:

Cannot load "services provider site". Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'my domain' is therefore not allowed access.

I tried modifying the js code of my site, I tried modifying the .htacces but nothing. I entered the Access-Control-Allow-Origin in many different ways. Is there a way to modify the server settings and configure the requests header? How can I modfy my requests' header?

Thank you very much for your help

Share this post


Link to post
Share on other sites

Hello,

I can't make any guarantees on this but maybe this will put you in the right direction.  We utilize Litespeed and I've seen a few ways thrown around on how to do this:

 

<FilesMatch "\.(gif|png|jpe?g|svg|svgz|ico|webp)$">
SetEnvIf Origin ":" IS_CORS
Header set Access-Control-Allow-Origin "*" env=IS_CORS
</FilesMatch>

<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css|css|woff2)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>

So in this case they're doing it for specific types.

There is also a discussion on the Litespeed forums on other ways to accomplish this: 

https://www.litespeedtech.com/support/forum/threads/header-set-access-control-allow-origin.8346/

 

Share this post


Link to post
Share on other sites
On 12/5/2017 at 8:46 PM, Tony said:

<FilesMatch "\.(gif|png|jpe?g|svg|svgz|ico|webp)$">

SetEnvIf Origin ":" IS_CORS
Header set Access-Control-Allow-Origin "*" env=IS_CORS
</FilesMatch>

<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css|css|woff2)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>

tried adding js but nothing.. Thank you for trying, I'll check something else for Litespeed

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this