\App\Http\MiddlewareJsonBodyGuardMiddleware

JSON 请求体限制

职责:限制 application/json 请求体大小上限 security.json_max_kb(默认 512KB), 防超大/深度嵌套 JSON 的资源耗尽型 DoS(解析深度由 PHP json 内置 512 层上限兜底)。

Summary

Methods
Properties
Constants
handle()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

handle()

handle(\Illuminate\Http\Request  $request, \Closure  $next) : \Symfony\Component\HttpFoundation\Response

处理请求:JSON 请求体超过上限即返回 413,否则放行。

Parameters

\Illuminate\Http\Request $request
\Closure $next

Returns

\Symfony\Component\HttpFoundation\Response —