Update uri.php

This commit is contained in:
Namhyeon Go 2020-12-26 03:14:02 +09:00 committed by GitHub
parent 1da455529b
commit 25fc749e27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,6 +115,7 @@ if(!is_fn("read_requests")) {
"_YAML" => false,
"_CSPT" => false,
"_SERVER" => array_map("make_safe_argument", get_array($_SERVER)),
"_HEADER" => getallheaders()
);
// check if json or serialized request
@ -431,3 +432,18 @@ if(!is_fn("set_header_content_type")) {
}
}
}
if(!is_fn("get_header_value")) {
function get_header_value($name) {
$value = false;
$requests = get_requests();
foreach ($requests['_HEADER'] as $k=>$v) {
if (strtolower($k) == strtolower($name)) {
$value = $v;
}
}
return $value;
}
}