From 375676016e7c70037e1ca386b32184c2e550ec97 Mon Sep 17 00:00:00 2001 From: Valentin Sickert <17144397+Lapotor@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:28:03 +0100 Subject: [PATCH] fix: set header to accept only json Signed-off-by: Valentin Sickert <17144397+Lapotor@users.noreply.github.com> --- app/Http/Responses/ApiErrorResponse.php | 2 +- app/Http/Responses/ApiSuccessResponse.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Responses/ApiErrorResponse.php b/app/Http/Responses/ApiErrorResponse.php index 4ad3845f..f78754c7 100644 --- a/app/Http/Responses/ApiErrorResponse.php +++ b/app/Http/Responses/ApiErrorResponse.php @@ -18,7 +18,7 @@ public function __construct( private $message, private ?Throwable $exception = null, private int $status = Response::HTTP_INTERNAL_SERVER_ERROR, - private array $headers = [] + private array $headers = ["Content-Type" => "application/json", "Accept" => "application/json"] ) {} /** diff --git a/app/Http/Responses/ApiSuccessResponse.php b/app/Http/Responses/ApiSuccessResponse.php index b8deb1ed..c2daec82 100644 --- a/app/Http/Responses/ApiSuccessResponse.php +++ b/app/Http/Responses/ApiSuccessResponse.php @@ -16,7 +16,7 @@ class ApiSuccessResponse implements Responsable public function __construct( private $data, private int $status = Response::HTTP_OK, - private array $headers = [] + private array $headers = ["Content-Type" => "application/json", "Accept" => "application/json"] ) {} /**