2017 © Pedro Peláez
 

library oc-cors-plugin

Setup and manage Cross-Origin Resource Sharing headers in October CMS

image

offline/oc-cors-plugin

Setup and manage Cross-Origin Resource Sharing headers in October CMS

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 4 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

CORS plugin for October CMS

This plugin is based on https://github.com/barryvdh/laravel-cors., (*1)

All configuration for the plugin can be done via the backend settings., (*2)

The following cors headers are supported:, (*3)

  • 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., (*4)

Setup

After installing the plugin visit the CORS settings page in your October CMS backend settings., (*5)

You can add * as an entry to Allowed origins, Allowed headers and Allowed methods to allow any kind of CORS request from everywhere., (*6)

It is advised to be more explicit about these settings. You can add values for each header via the repeater fields., (*7)

It is important to set these intial settings once for the plugin to work as excpected!, (*8)

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., (*9)

The filesystem configuration will overwrite any defined backend setting., (*10)

<?php
// plugins/offline/cors/config/config.php
return [
    'supportsCredentials'         => true,
    'maxAge'                      => 3600,
    'allowedOrigins'              => ['*'],
    'allowedHeaders'              => ['*'],
    'allowedMethods'              => ['GET', 'POST'],
    'exposedHeaders'              => [''],
    'preflightResponseStatusCode' => 204,
];

The Versions

17/02 2018

dev-master

9999999-dev

Setup and manage Cross-Origin Resource Sharing headers in October CMS

  Sources   Download

MIT

by Tobias Kündig

17/02 2018

v1.0.4

1.0.4.0

Setup and manage Cross-Origin Resource Sharing headers in October CMS

  Sources   Download

MIT

by Tobias Kündig

17/02 2018

dev-develop

dev-develop

Setup and manage Cross-Origin Resource Sharing headers in October CMS

  Sources   Download

MIT

by Tobias Kündig

12/02 2018

v1.0.3

1.0.3.0

Setup and manage Cross-Origin Resource Sharing headers in October CMS

  Sources   Download

MIT

by Tobias Kündig