mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-03-18 01:10:01 +01:00
18 lines
437 B
PHP
18 lines
437 B
PHP
<?php
|
|
|
|
namespace Poniverse\Ponyfm\Http\Middleware;
|
|
|
|
use App;
|
|
|
|
class Cors {
|
|
public function handle($request, $next)
|
|
{
|
|
if (App::environment('local', 'staging')) {
|
|
return $next($request)
|
|
->header('Access-Control-Allow-Origin', '*')
|
|
->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
|
|
} else {
|
|
return $next($request);
|
|
}
|
|
}
|
|
}
|