Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.3-develop' into 5.3-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
brookgagnon committed Oct 24, 2024
2 parents 327cf11 + 76f0692 commit 4225dfb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions api.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ class OBFAPI

public function __construct()
{
// merge in our apache headers with $_SERVER (if not already set)
if (function_exists('apache_request_headers')) {
$headers = apache_request_headers();
foreach ($headers as $header => $value) {
$value = trim($value);
$index = 'HTTP_' . strtoupper(str_replace('-', '_', trim($header)));
if (!isset($_SERVER[$index])) {
$_SERVER[$index] = $value;
}
}
}

if (str_starts_with($_SERVER['REQUEST_URI'], '/api/v2/')) {
// we have routes for this request method? find the regex pattern to match with, and variables to extract.
$routes = json_decode(file_get_contents('routes.json'));
Expand Down

0 comments on commit 4225dfb

Please sign in to comment.