From 6eec298bfe626a53a5c05a040c04eb08e1f2a69c Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 28 Apr 2024 19:54:57 +0300 Subject: [PATCH] set empty request value to / by protocol specification --- src/nex.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nex.php b/src/nex.php index a153feb..2f83342 100644 --- a/src/nex.php +++ b/src/nex.php @@ -187,6 +187,8 @@ $server->start( $request ); + $request = empty($request) ? '/' : $request; + // Build realpath $realpath = realpath( NEXT_PATH . @@ -338,7 +340,7 @@ $server->start( (string) (int) is_string($response), (string) parse_url($url, PHP_URL_HOST), (string) parse_url($url, PHP_URL_PORT), - (string) str_replace('%', '%%', empty($request) ? '/' : $request), + (string) str_replace('%', '%%', $request), (string) str_replace('%', '%%', empty($realpath) ? '!' : $realpath), (string) mb_strlen((string) $response) ],