Carry headers through the handler
This commit is contained in:
@@ -40,9 +40,7 @@ class GenericException extends HttpException
|
|||||||
public function getErrorMetadata(): array
|
public function getErrorMetadata(): array
|
||||||
{
|
{
|
||||||
$metadata = [];
|
$metadata = [];
|
||||||
$metadata['error'] = [
|
$metadata['original_exception'] = get_class($this->exception);
|
||||||
'original_exception' => get_class($this->exception),
|
|
||||||
];
|
|
||||||
|
|
||||||
// Only add trace if in dev
|
// Only add trace if in dev
|
||||||
if (config('app.env') === 'dev') {
|
if (config('app.env') === 'dev') {
|
||||||
|
|||||||
@@ -49,13 +49,15 @@ abstract class HttpException extends SymfonyHttpException
|
|||||||
*/
|
*/
|
||||||
public function getResponse()
|
public function getResponse()
|
||||||
{
|
{
|
||||||
|
$headers = [];
|
||||||
|
$headers['content-type'] = 'application/problem+json';
|
||||||
|
$headers = array_merge($headers, $this->getHeaders());
|
||||||
|
|
||||||
return response()
|
return response()
|
||||||
->json(
|
->json(
|
||||||
$this->getJson(),
|
$this->getJson(),
|
||||||
$this->getStatusCode(),
|
$this->getStatusCode(),
|
||||||
[
|
$headers
|
||||||
'content-type' => 'application/problem+json',
|
|
||||||
]
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user