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);
|
$thelia = new Thelia("dev", true);
|
||||||
|
|
||||||
if ( false === in_array($request->getClientIp(), $trustedIp)) {
|
if ( false === in_array($request->getClientIp(), $trustedIp)) {
|
||||||
// Redirect 401 Unauthorized
|
$response = Response::create('Forbidden', 403)->send();
|
||||||
$response = new Response('Unauthorized', 401);
|
$thelia->terminate($request, $response);
|
||||||
|
} else {
|
||||||
|
$response = $thelia->handle($request)->prepare($request)->send();
|
||||||
$thelia->terminate($request, $response);
|
$thelia->terminate($request, $response);
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = $thelia->handle($request)->prepare($request)->send();
|
|
||||||
|
|
||||||
$thelia->terminate($request, $response);
|
|
||||||
Reference in New Issue
Block a user