zxin / think-cors
Installs: 1 123
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.4|^8.0
- symfony/polyfill-php80: ^1
- topthink/framework: ^6.1|~8.0.1
Requires (Dev)
- php-cs-fixer/shim: ^3.22
- phpstan/phpstan: ^1.10.28
- phpunit/phpunit: ^9
- symfony/var-dumper: ^5.4|^6.0
README
全局启用
- 配置服务注册 (app/service.php):
\Zxin\Think\Cors\Service::class
局部启用
- 配置服务注册 (app/service.php):
\Zxin\Think\Cors\Service::class
- 禁用自动注册中间件:
config.cors.auto_register_middleware => false
- 注册中间件:
\Zxin\Think\Cors\CorsMiddleware::class
- 确保优先级:
config.middleware.priority
代码引用
TODO
- 新的参考跟踪 fruitcake/php-cors