Skip to content

Commit bb9a19a

Browse files
authored
Fix built-in server routing (#95)
1 parent dbda58c commit bb9a19a

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

public/index-test.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
// PHP built-in server routing.
88
if (PHP_SAPI === 'cli-server') {
99
// Serve static files as is.
10-
if (is_file(__DIR__ . $_SERVER["REQUEST_URI"])) {
10+
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
11+
if (is_file(__DIR__ . $path)) {
1112
return false;
1213
}
1314

public/index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
// PHP built-in server routing.
88
if (PHP_SAPI === 'cli-server') {
99
// Serve static files as is.
10-
if (is_file(__DIR__ . $_SERVER["REQUEST_URI"])) {
10+
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
11+
if (is_file(__DIR__ . $path)) {
1112
return false;
1213
}
1314

0 commit comments

Comments
 (0)