offline/oc-cors-plugin
Composer 安装命令:
composer require offline/oc-cors-plugin
包简介
Setup and manage Cross-Origin Resource Sharing headers in October CMS
README 文档
README
This plugin is based on https://github.com/barryvdh/laravel-cors.
All configuration for the plugin can be done via the backend settings.
The following cors headers are supported:
- Access-Control-Allow-Origin
- Access-Control-Allow-Headers
- Access-Control-Allow-Methods
- Access-Control-Allow-Credentials
- Access-Control-Expose-Headers
- Access-Control-Max-Age
Currently these headers are sent for every request. There is no per-route configuration possible at this time.
Setup
After installing the plugin visit the CORS settings page in your October CMS backend settings.
You can add * as an entry to Allowed origins, Allowed headers and Allowed methods to allow any kind of CORS request from everywhere.
It is advised to be more explicit about these settings. You can add values for each header via the repeater fields.
It is important to set these intial settings once for the plugin to work as excpected!
Filesystem configuration
As an alternative to the backend settings you can create a config/config.php file in the plugins root directory to configure it.
The filesystem configuration will overwrite any defined backend setting.
<?php // plugins/offline/cors/config/config.php return [ 'supportsCredentials' => true, 'maxAge' => 3600, 'allowedOrigins' => ['*'], 'allowedHeaders' => ['*'], 'allowedMethods' => ['GET', 'POST'], 'exposedHeaders' => [''], 'preflightResponseStatusCode' => 204, ];
offline/oc-cors-plugin 适用场景与选型建议
offline/oc-cors-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 203 次下载、GitHub Stars 达 12, 最近一次更新时间为 2018 年 02 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 offline/oc-cors-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 offline/oc-cors-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 203
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-02-12