CORS Requests


fausto94

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

Link to comment
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/

 

Link to comment
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

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...