From 614f819d6644350d36c43e4973b87ccda8ed53f3 Mon Sep 17 00:00:00 2001 From: nmuecke Date: Fri, 15 Mar 2019 11:05:06 +1100 Subject: [PATCH] Added withException --- src/EnforceContentSecurity.php | 8 ++++++++ 1 file changed, 8 insertions(+) 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;