PHPackages                             ventusforge/flow-cors - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. ventusforge/flow-cors

ActiveNeos-application[HTTP &amp; Networking](/categories/http)

ventusforge/flow-cors
=====================

CORS HTTP package for Neos

0.0.1(4mo ago)02GPL-3.0-or-laterPHPPHP &gt;=8.3CI passing

Since Dec 27Pushed 3mo agoCompare

[ Source](https://github.com/VentusForge/VentusForge.Cors)[ Packagist](https://packagist.org/packages/ventusforge/flow-cors)[ RSS](/packages/ventusforge-flow-cors/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

VentusForge.CORS
================

[](#ventusforgecors)

This package provides a simple CORS controller for Flow applications.

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

Configuration
-------------

[](#configuration)

### Enable CORS support

[](#enable-cors-support)

```
VentusForge:
  Cors:
    enabled: true
```

### Add different headers for a path

[](#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

[](#override-the-origins)

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

Use the Abstract CORS Controller
--------------------------------

[](#use-the-abstract-cors-controller)

```
