Skip to content

Commit ed70343

Browse files
committed
fix: [php] Use only the path to identify route
1 parent 3d7f348 commit ed70343

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

php/index.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
require __DIR__ . '/vendor/autoload.php';
44

5-
# Set up the route handlers.
5+
// Set up the route handlers.
66
use App\Route\Metrics;
77
use App\Route\Headers;
88

99
// Basic routing
10-
switch ($_SERVER['REQUEST_URI']) {
10+
$uri_components = parse_url($_SERVER['REQUEST_URI']);
11+
switch ($uri_components['path']) {
1112
case '/metrics':
1213
return Metrics::render();
1314
case '/headers':

0 commit comments

Comments
 (0)