diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 98ee8323bd..aab0b085da 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -65,6 +65,7 @@ class Handler extends ExceptionHandler TokenMismatchException::class, HttpException::class, SuspiciousOperationException::class, + BadHttpHeaderException::class, ]; /** diff --git a/app/Http/Middleware/AcceptHeaders.php b/app/Http/Middleware/AcceptHeaders.php index 8debaf520d..c7de9c452b 100644 --- a/app/Http/Middleware/AcceptHeaders.php +++ b/app/Http/Middleware/AcceptHeaders.php @@ -46,8 +46,8 @@ class AcceptHeaders { $method = $request->getMethod(); - if ('GET' === $method && !$request->accepts(['application/json', 'application/vdn.api+json'])) { - throw new BadHttpHeaderException('Your request must accept either application/json or application/vdn.api+json.'); + if ('GET' === $method && !$request->accepts(['application/json', 'application/vnd.api+json'])) { + throw new BadHttpHeaderException('Your request must accept either application/json or application/vnd.api+json'); } $allowed = ['application/x-www-form-urlencoded', 'application/json','']; $submitted = (string)$request->header('Content-Type');