Initial commit
This commit is contained in:
22
getrequestheaders.php
Normal file
22
getrequestheaders.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
if(!function_exists('getallheaders')){
|
||||
http_response_code(403);
|
||||
echo "Access Denied 900";
|
||||
exit();
|
||||
}
|
||||
$headers = [];
|
||||
foreach (getallheaders() as $name => $value) {
|
||||
// echo "$name: $value <br>" . PHP_EOL;
|
||||
$headers[$name] = $value;
|
||||
}
|
||||
|
||||
|
||||
list($type, $bearer_data) = explode(" ", $headers['Authorization'], 2);
|
||||
$retval = $auth->read_api_auth($bearer_data);
|
||||
|
||||
if ($retval == null) {
|
||||
echo json_encode(['Access Denied']);
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user