middlewares/cors

Name: cors

Owner: Middlewares

Description: PSR-15 middleware to implement Cross-Origin Resource Sharing (CORS)

Created: 2016-10-09 09:59:04.0

Updated: 2018-03-21 07:31:59.0

Pushed: 2018-01-25 22:40:16.0

Homepage: null

Size: 23

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

middlewares/cors

Latest Version on Packagist Software License Build Status Quality Score Total Downloads SensioLabs Insight

Middleware to implement Cross-Origin Resource Sharing (CORS) using neomerx/cors-psr7.

Requirements
Installation

This package is installable and autoloadable via Composer as middlewares/cors.

oser require middlewares/cors
Example
Neomerx\Cors\Strategies\Settings;
Neomerx\Cors\Analyzer;

tings = new Settings();
tings->setServerOrigin([
'scheme' => 'http',
'host' => 'example.com',
'port' => '123',


lyzer = Analyzer::instance($settings);

patcher = new Dispatcher([
new Middlewares\Cors($analyzer)


ponse = $dispatcher->dispatch(new ServerRequest());
Options
__construct(Neomerx\Cors\Contracts\AnalyzerInterface $analyzer)

The CORS analyzer used. See neomerx/cors-psr7 for more info.


Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.

The MIT License (MIT). Please see LICENSE for more information.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.