📌  相关文章
📜  express 中的预检响应不允许标头 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:45.648000             🧑  作者: Mango

代码示例1
$app->after(function (Request $request, Response $response) {
        $response->headers->set('Access-Control-Allow-Origin', '*');
        $response->headers->set("Access-Control-Allow-Credentials", "true");
        $response->headers->set("Access-Control-Allow-Methods", "GET,HEAD,OPTIONS,POST,PUT");
        $response->headers->set("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization");
    });