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 initial settings once for the plugin to work as expected!
-
Pavlov
Found the plugin useful on 1 Jun, 2020
Great UI to manage the CORS headers. Once everything is set up, it just works!
-
Felipe Jiménez
Found the plugin useful on 27 Aug, 2019
Hi, the plugin is very useful to non devs administrators, but actually I have an error when I'm uploading an image. I had two differents errors depends on the OS where I'm working on. On Linux the error is "Uncaught SyntaxError: Unexpected token < in JSON at position 0" and on Windows/Mac is "POST https://content.example.com/contenteditor/image/upload net::ERR_FAILED". Soon I put more details on an Issue in GIT.
-
Meysam Mahfouzi
Found the plugin not useful on 20 Nov, 2017
Not always works as expected. I have deployed it to a server where it doesn't respond to OPTIONS at all (but it includes the CORS headers in response to other requests).
-
OFFLINE author
Replied on 21 Nov, 2017
Hi
Thank you for your review. This sounds more like a problem with the server setup than with the plugin.
All the plugin does is add the necessary response headers. If you don't receive any response to a OPTIONS request, it looks like the request never even reached your october codebase.
Feel free to post any additional information on the plugin's github page. If it is a bug in the plugin we might fix it this way.
-
1.1.1 |
Added response status code to plugin settings Jan 05, 2024 |
---|---|
1.1.0 |
Added response status code to plugin settings Jan 05, 2024 |
1.0.7 |
Optimized compatibility with October v2 Dec 03, 2021 |
1.0.6 |
Dummy release to sync with Packagist version May 17, 2021 |
1.0.5 |
Return proper 204 response code for preflight requests (thanks to @adrian-marinescu-ch on GitHub) May 17, 2021 |
1.0.4 |
Fixed minor bug when running the plugin without custom settings Feb 17, 2018 |
1.0.3 |
Added support for filesystem configuration file / Added plugin to Packagist (https://packagist.org/packages/offline/oc-cors-plugin) Feb 14, 2018 |
1.0.2 |
Fixed backend settings label (thanks to LukeTowers) Feb 14, 2017 |
1.0.1 |
Initial release. Dec 23, 2016 |