CORS: allow any origin for data.php
davvalent

davvalent commited on 2024-03-09 20:03:13
Showing 1 changed files, with 11 additions and 1 deletions.

... ...
@@ -55,12 +55,22 @@
55 55
     }
56 56
   }
57 57
 
58
-  /** Handling CORS */
59 58
   $request_headers = getallheaders();
59
+
60
+  /**
61
+   * Handling CORS
62
+   * Deprecated since we allow any origin as of 2024-03-09
63
+   */
64
+
65
+  /*
60 66
   $local_host_referer = (str_contains($request_headers['Referer'], "localhost"))
61 67
     ? "http://localhost"
62 68
     : "https://qdmtl.ca";
63 69
   header('Access-Control-Allow-Origin: ' . $local_host_referer);
70
+  */
71
+
72
+  // allow any origin
73
+  header('Access-Control-Allow-Origin: *');
64 74
 
65 75
     /** Access to Accept header value */
66 76
   $accept_header = $request_headers['Accept'];
67 77