Created
May 5, 2017 12:52
-
-
Save jleonardolemos/e27e7056030818725661deb295ab66fc to your computer and use it in GitHub Desktop.
middleware laravel para permitir cross domain
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
class Cors { | |
public function handle($request, Closure $next) | |
{ | |
return $next($request) | |
->header('Access-Control-Allow-Origin', '*') | |
//->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS') | |
//->header('Access-Control-Allow-Credentials', 'true') | |
//->header('Access-Control-Max-Age', '10000') | |
//->header('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-Requested-With, x-xsrf-token'); | |
->header('Access-Control-Allow-Headers', 'x-xsrf-token'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment