This commit is contained in:
2023-09-15 15:58:24 +08:00
parent 779cccd331
commit 3d6099ea6e
2 changed files with 5 additions and 6 deletions
+2 -4
View File
@@ -4,7 +4,6 @@ declare(strict_types=1);
namespace Kiri\Router\Base;
use Kiri\Di\Context;
use Psr\Http\Message\ResponseInterface;
class NotFoundController extends Controller
@@ -16,11 +15,10 @@ class NotFoundController extends Controller
*/
public function fail(): ResponseInterface
{
$response = Context::get(ResponseInterface::class);
if ($this->request->getMethod() == 'OPTIONS') {
return $response->withStatus(200, "");
return \response()->withStatus(200, "empty content");
} else {
return $response->withStatus(404, "not found page.");
return \response()->withStatus(404, "not found page.");
}
}