diff --git a/src/Action/MenuAction.php b/src/Action/MenuAction.php index eaf0356..2390a61 100644 --- a/src/Action/MenuAction.php +++ b/src/Action/MenuAction.php @@ -44,15 +44,19 @@ public function handle(Request $request) } $menu = $this->boltConfig->get('menu' . $name, false); - + if (! $menu) { throw new ApiNotFoundException( "Menu with name [$name] not found." ); } - return new ApiResponse([ + $response = new ApiResponse([ 'data' => $menu, ], $this->extensionConfig); + + $response->headers->set('Content-Type', 'application/json'); + + return $response; } } diff --git a/src/Action/TaxonomyAction.php b/src/Action/TaxonomyAction.php index 24beb53..7ab1840 100644 --- a/src/Action/TaxonomyAction.php +++ b/src/Action/TaxonomyAction.php @@ -51,8 +51,12 @@ public function handle(Request $request) ); } - return new ApiResponse([ + $response = new ApiResponse([ 'data' => $taxonomy, ], $this->extensionConfig); + + $response->headers->set('Content-Type', 'application/json'); + + return $response; } }