diff --git a/src/EnforceContentSecurity.php b/src/EnforceContentSecurity.php index 2fbbb26..23a1a06 100644 --- a/src/EnforceContentSecurity.php +++ b/src/EnforceContentSecurity.php @@ -1,6 +1,7 @@ setProfilesWithParameters(func_get_args()); + $exception = $response->exception; + $psr7Response = $this->createPsr7Response($response); $psr7Response = $this->addPolicyHeader($psr7Response); $response = $this->createLaravelResponse($psr7Response); + + if ($exception instanceof Exception) { + $response->withException($exception); + } + } return $response;