From 1957fc789d9a04672e028a6cf0d170f89ce5e6dc Mon Sep 17 00:00:00 2001 From: "DESKTOP-GBA0BK8\\Admin" Date: Wed, 19 Apr 2023 18:56:02 -0400 Subject: [PATCH] add to .htaccess --- www-api/public/.htaccess | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/www-api/public/.htaccess b/www-api/public/.htaccess index a5d6c2a5..83ffbc6f 100644 --- a/www-api/public/.htaccess +++ b/www-api/public/.htaccess @@ -26,6 +26,14 @@ Options All -Indexes RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L] + #Redirect for CORS Preflight request + RewriteCond %{REQUEST_METHOD} OPTIONS + RewriteRule ^(.*)$ $1 [R=200,L] + #Set headers to access CORS Requests / allowing localhost only + Header always add Access-Control-Allow-Origin "*" + Header always add Access-Control-Allow-Headers "origin, x-requested-with, content-type" + Header always add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS" + # Checks to see if the user is attempting to access a valid file, # such as an image or css document, if this isn't true it sends the # request to the front controller, index.php