Skip to content
This repository was archived by the owner on May 1, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public static function handle($class, $method, $vars, $routeParams)
}
catch (\Throwable $e)
{
throw new \Exception($e->getMessage());
self::displayError('Signature verification failed', 400);
}
}

Expand Down Expand Up @@ -246,7 +246,8 @@ public static function fetch_from_array(&$array, $index=null, $default = null)
private static function getAuthorizationHeader() {
// convert all headers to lowercase:
$headers = array();
foreach($_SERVER as $key => $value) {
$header_variables = array_merge($_SERVER, getallheaders());
foreach($header_variables as $key => $value) {
$headers[strtolower($key)] = $value;
}

Expand Down Expand Up @@ -310,4 +311,4 @@ public static function displayError ($message, $status = 500) {

// set_error_handler("ProcessWire\Router::handleError");
// set_exception_handler('ProcessWire\Router::handleException');
// register_shutdown_function('ProcessWire\Router::handleFatalError');
// register_shutdown_function('ProcessWire\Router::handleFatalError');