for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Firesphere\GraphQLJWT\Helpers;
use SilverStripe\Control\HTTPRequest;
class HeaderExtractor
{
/**
* @param HTTPRequest $request
* @return array
*/
public static function getAuthorizationHeader(HTTPRequest $request)
$authHeader = $request->getHeader('Authorization');
if ($authHeader && preg_match('/Bearer\s+(.*)$/i', $authHeader, $matches)) {
return $matches;
}
return [0, null];