send 403 response if clientdon't have trusted IP
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user