Get header in middleware works with PHP dev server on local machine, but not on a LAMP
I have an API written in Lumen that works exactly as expected on my local PHP dev server (php -S in {project_directory}/public/), but on my dev server (Amazon Linux LAMP, all default settings for dev purposes) it returns NULL when trying to the the Authorization header. I have other Laravel applications on the same type of configuration that work perfectly, and ideas?
public function handle($request, Closure $next)
{
$apiKey = $request->headers->get('Authorization');
dd($apiKey);
if(self::validateApiKey($apiKey)) {
return $next($request);
} else {
return response()->json(['error' => 'The given API key is invalid.'])->setStatusCode(401);
}
}