🚀 مُصادَق: تحديث برمجي جديد 2026-05-03 01:31
This commit is contained in:
@@ -18,7 +18,15 @@ final class Request
|
||||
public function __construct()
|
||||
{
|
||||
$this->method = $_SERVER['REQUEST_METHOD'];
|
||||
$this->path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
||||
|
||||
// Normalize path: extract /api/v1/... portion from any subdirectory structure
|
||||
$rawPath = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
||||
$apiPos = strpos($rawPath, '/api/v1/');
|
||||
if ($apiPos !== false) {
|
||||
$this->path = substr($rawPath, $apiPos); // e.g. /api/v1/auth/login
|
||||
} else {
|
||||
$this->path = $rawPath;
|
||||
}
|
||||
$this->headers = getallheaders();
|
||||
$this->queryParams = $_GET;
|
||||
$this->files = $_FILES;
|
||||
|
||||
Reference in New Issue
Block a user