core/modules/rest/src/RequestHandler.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/modules/rest/src/RequestHandler.php b/core/modules/rest/src/RequestHandler.php index 8e0cd74..053101a 100644 --- a/core/modules/rest/src/RequestHandler.php +++ b/core/modules/rest/src/RequestHandler.php @@ -90,6 +90,10 @@ public function handle(RouteMatchInterface $route_match, Request $request) { $response = call_user_func_array(array($resource, $method), array_merge($parameters, array($unserialized, $request))); } catch (HttpException $e) { + if ($e->getStatusCode() == 403) { + throw $e; + } + $error['error'] = $e->getMessage(); $content = $serializer->serialize($error, $format); // Add the default content type, but only if the headers from the