blessing-skin-server/app/Http/Middleware/ForbiddenIE.php

20 lines
391 B
PHP
Raw Normal View History

2019-04-22 21:09:36 +08:00
<?php
namespace App\Http\Middleware;
2019-12-14 11:10:37 +08:00
use App\Exceptions\PrettyPageException;
2019-04-22 21:09:36 +08:00
use Closure;
use Illuminate\Support\Str;
class ForbiddenIE
{
public function handle($request, Closure $next)
{
if (Str::contains($request->userAgent(), ['Trident', 'MSIE'])) {
throw new PrettyPageException(trans('errors.http.ie'));
}
return $next($request);
}
}