35 lines
667 B
PHP
35 lines
667 B
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Cachet.
|
|
*
|
|
* (c) James Brooks <james@cachethq.io>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace CachetHQ\Cachet\Http\Middleware;
|
|
|
|
use Closure;
|
|
|
|
class Cors
|
|
{
|
|
/**
|
|
* Run the cors middleware.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @param \Closure $next
|
|
*
|
|
* @return mixed
|
|
*/
|
|
public function handle($request, Closure $next)
|
|
{
|
|
$response = $next($request);
|
|
|
|
$response->headers->set('Access-Control-Allow-Origin', '*');
|
|
|
|
return $response;
|
|
}
|
|
}
|