I am building a Laravel 5 REST API. And the angular application conduct JSONP CORS request to the api, but I get Error 302 and redirect to '/'. The server has correct CORS configuration, I don't know where is wrong.
The general information of the request:
Request URL:http://example.com/api/getinfo?_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9&callback=angular.callbacks._0
Request Method:GET
Status Code:302 Found
The request headers:
Access-Control-Allow-Headers:Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With,Content-Length, Accept, x-csrf-token, origin
Access-Control-Allow-Methods:POST, GET, OPTIONS, PUT, DELETE
Access-Control-Allow-Origin:*
Cache-Control:no-cache
Connection:keep-alive
Content-Length:380
Content-Type:text/html; charset=UTF-8
Date:Fri, 15 Apr 2016 18:21:42 GMT
Location:http://example.com
Server:nginx
Set-Cookie:laravel_session=4aba180c69376045bad0e16c185ac60568378dcb; expires=Fri, 15-Apr-2016 20:21:42 GMT; path=/; httponly