6.0 rc2 allowCrossDomain 中间件bug

浏览:369 发布日期:2019/04/22
5.0.0 - 普通 - 已处理
[0] TypeError in AllowCrossDomain.php line 38
Argument 3 passed to think\middleware\AllowCrossDomain::handle() must be of the type array, null given

/**
* 允许跨域请求
* @access public
* @param Request $request
* @param Closure $next
* @param array $header
* @return Response
*/
public function handle($request, Closure $next, array $header = [])
{
$header = !empty($header) ? array_merge($this->header, $header) : $this->header;

if ($request->method(true) == 'OPTIONS') {
return Response::create()->code(204)->header($header);
}

return $next($request);
}
评论(
后面还有条评论,点击查看>>