Skip to content

Commit cdeeace

Browse files
DavertMikclaude
andcommitted
Fix test router to handle query strings in URL paths
Changed glue.php router to strip query strings from REQUEST_URI before matching route patterns. This fixes 500 errors when accessing URLs like /info?user=test because the regex pattern ^/info/?$ didn't match /info?user=test. Changed from: $path = $_SERVER['REQUEST_URI']; To: $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 06fe960 commit cdeeace

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/data/app/glue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class glue {
4444
static function stick ($urls) {
4545

4646
$method = strtoupper($_SERVER['REQUEST_METHOD']);
47-
$path = $_SERVER['REQUEST_URI'];
47+
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
4848

4949
$found = false;
5050

0 commit comments

Comments
 (0)