This commit is contained in:
2021-03-23 11:22:25 +08:00
parent ab3083e490
commit fe31c36bac
3 changed files with 91 additions and 35 deletions
+3 -2
View File
@@ -576,17 +576,18 @@ class Node extends HttpService
private function httpFilter(): mixed
{
try {
if (!is_array($this->handler)) {
if ($this->handler instanceof Closure) {
return $this->runWith(...func_get_args());
}
/** @var HttpFilter $filter */
$filter = Snowflake::app()->get('filter');
$validator = $filter->check(get_class($this->handler[0]), $this->handler[1]);
if (!($validator instanceof Validator)) {
return $this->runWith(...func_get_args());
}
if (!$validator->validation()) {
var_dump($validator->getError());
return Json::to(401, $validator->getError());
}
return $this->runWith(...func_get_args());