From f4bff3fdc9017781d769ef19fa4094aa5958623e Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Sat, 5 Oct 2013 10:51:32 +0200 Subject: [PATCH] send 403 response if clientdon't have trusted IP --- web/index_dev.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/index_dev.php b/web/index_dev.php index 0e9a229a8..f653270d6 100755 --- a/web/index_dev.php +++ b/web/index_dev.php @@ -42,11 +42,11 @@ $request = Request::createFromGlobals(); $thelia = new Thelia("dev", true); if ( false === in_array($request->getClientIp(), $trustedIp)) { - // Redirect 401 Unauthorized - $response = new Response('Unauthorized', 401); + $response = Response::create('Forbidden', 403)->send(); + $thelia->terminate($request, $response); +} else { + $response = $thelia->handle($request)->prepare($request)->send(); $thelia->terminate($request, $response); } -$response = $thelia->handle($request)->prepare($request)->send(); -$thelia->terminate($request, $response); \ No newline at end of file