title: Response header name 'Access-Control-Allow-Origin ' contains invalid characters, aborting request
body: <p>I have a laravel app (deployed on heroku) where I am receiving a <code>500 Internal Server error</code>.</p>
  
  <p>When I checked my logs, I get the error metheod in the title:</p>
  
  <blockquote>
    <p>Response header name 'Access-Control-Allow-Origin ' contains invalid characters, aborting request</p>
  </blockquote>
  
  <p>I have a <code>cors middleware</code> with the following code:</p>
  
  <pre><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);
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>