定制 ventusforge/flow-cors 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ventusforge/flow-cors

最新稳定版本:0.0.1

Composer 安装命令:

composer require ventusforge/flow-cors

包简介

CORS HTTP package for Neos

README 文档

README

This package provides a simple CORS controller for Flow applications.

The headers are only applied if the controller extends the AbstractCorsController class.

Configuration

Enable CORS support

VentusForge:
  Cors:
    enabled: true

Add different headers for a path

VentusForge:
  Cors:
    headers:
      /api/v1/some-api/create:
        'Access-Control-Allow-Methods':
          - 'PUT'
          - 'OPTIONS'

If a header is not defined, the default value from VentusForge.Cors.headers.defaults is used.

To remove a header, set it to null.

Override the origins

VentusForge:
  Cors:
    enabled: false
    headers:
      defaults:
        'Access-Control-Allow-Origin':
          - .foo-bar.com
          - .bar-baz.com'

Use the Abstract CORS Controller

<?php

declare(strict_types=1);

namespace Foo\Bar\Controller;

use Neos\Flow\Annotations as Flow;

class SomeController extends \VentusForge\Cors\Controller\AbstractCorsController
{
    /**
     * @inheritDoc
     */
    protected function initializeAction(): void
    {
        // if you override the initializeAction() method, make sure to call the parent method
        parent::initializeAction();
    }
}

Planned features

  • Replace the controller with a middleware

统计信息

  • 总下载量: 20
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2026-01-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固