benkle / auto-preflight-bundle
一个用于自动生成CORS预检请求响应的简单包。
0.90
2016-10-14 13:04 UTC
Requires
- symfony/dependency-injection: >=2.8
- symfony/http-foundation: >=2.8
- symfony/http-kernel: >=2.8
- symfony/routing: >=2.8
Requires (Dev)
- phpunit/phpunit: ^5.4
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_origin和allow_headers都是字符串值,并以原始形式发送到浏览器。
您还必须在路由定义中使用methods字段,否则只能使用GET
。