benkle/auto-preflight-bundle

一个用于自动生成CORS预检请求响应的简单包。

安装: 209

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:symfony-bundle

0.90 2016-10-14 13:04 UTC

This package is not auto-updated.

Last update: 2024-09-24 22:05:00 UTC


README

一个用于自动生成CORS预检请求响应的简单包。

安装

使用composer安装。

$ composer require benkle/auto-preflight-bundle

将此添加到您的kernel bundles中

new Benkle\AutoPreflightBundle\BenkleAutoPreflightBundle(),

配置

将此部分添加到您的config.yaml

benkle_auto_preflight:
    allow_origin: '*'
    allow_headers: x-auth-token

目前,allow_originallow_headers都是字符串值,并以原始形式发送到浏览器。

您还必须在路由定义中使用methods字段,否则只能使用GET