Skip to content

Commit 057013a

Browse files
committed
* 修复支持静态文件访问的bug
1 parent db277db commit 057013a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/Route/NormalRoute.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public function __construct()
4949
*/
5050
public function handleHttpRequest($request)
5151
{
52+
$this->routeParams->file = '';
5253
$host = $request->header['host'] ?? '';
5354
if ($host) {
5455
$host = explode(':', $host)[0] ?? '';
@@ -124,8 +125,6 @@ public function parsePath($path)
124125
$root = getInstance()->config['http']['domain'][$this->getHost()]['root'] ?? ROOT_PATH . '/www/';
125126
$this->routeParams->file = $root . $path;
126127
return true;
127-
} else {
128-
$this->routeParams->file = '';
129128
}
130129

131130
$route = explode('/', ltrim($path, '/'));

0 commit comments

Comments
 (0)