I have a laravel app (deployed on heroku) where I am receiving a 500 Internal Server error.
When I checked my logs, I get the error metheod in the title:
Response header name 'Access-Control-Allow-Origin ' contains invalid characters, aborting request
I have a cors middleware with the following code:
public function handle($request, Closure $next)
{
header('Access-Control-Allow-Origin : *');
header('Access-Control-Allow-Headers : Content-type, X-Auth-Token, Authorization, Origin');
return $next($request);
}
What am I doing wrong?