update getallheaders

This commit is contained in:
franknstayn
2021-12-01 19:31:55 +08:00
parent f07e5aaa8e
commit 9ed77a3451

View File

@@ -1,8 +1,11 @@
<?php namespace App\Http\Middleware;
<?php
namespace App\Http\Middleware;
use Closure;
class isAuthorized {
class isAuthorized
{
/**
* Handle an incoming request.
@@ -20,4 +23,14 @@ class isAuthorized {
}
}
function getallheaders()
{
$headers = [];
foreach ($_SERVER as $name => $value) {
if (substr($name, 0, 5) == 'HTTP_') {
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
}
}
return $headers;
}
}