📌  相关文章
📜  cors header 'access-control-allow-origin' 在特定的 CAKEPHP API 中丢失 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:54.685000             🧑  作者: Mango

代码示例1
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, PUT, PATCH, DELETE, OPTIONS');
header('Access-Control-Allow-Headers: *');
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
    exit(0);
}