I'm using the BlockAttack for a notification only purpose. To prevent the middleware from returning an error I set the config attack_blocker.response.code => 200.
When an inconming request is considered as an attack I get notified as expected but I also get an Exception from the Laravel StartSession Middleware:
Argument 1 passed to Illuminate\Session\Middleware\StartSession::addCookieToResponse() must be an instance of Symfony\Component\HttpFoundation\Response, null given, called in /home/ryan/project/eurecab/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php on line 60
The problem comes from the Support\Responder class when in the case of the attack_blocker.response.code = 200, the Responder will return a null response to the BlockAttack middleware which is called from the StartSession middleware.
/**
* Properly respond.
*
* @var \Illuminate\Support\Collection
*
* @return mixed
*/
public function respond($response, $data = [])
{
if ($response['code'] === 200) {
return; <= null returned
}
[...]
}
Hello,
I'm using the BlockAttack for a notification only purpose. To prevent the middleware from returning an error I set the config attack_blocker.response.code => 200.
When an inconming request is considered as an attack I get notified as expected but I also get an Exception from the Laravel StartSession Middleware:
Argument 1 passed to Illuminate\Session\Middleware\StartSession::addCookieToResponse() must be an instance of Symfony\Component\HttpFoundation\Response, null given, called in /home/ryan/project/eurecab/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php on line 60
The problem comes from the Support\Responder class when in the case of the attack_blocker.response.code = 200, the Responder will return a null response to the BlockAttack middleware which is called from the StartSession middleware.