diff --git a/src/Http/Controllers/ScriptController.php b/src/Http/Controllers/ScriptController.php index bf9dcc9..57d495d 100644 --- a/src/Http/Controllers/ScriptController.php +++ b/src/Http/Controllers/ScriptController.php @@ -13,10 +13,8 @@ class ScriptController extends Controller */ public function __invoke(Request $request) { - $scriptPath = LaRecipe::allScripts()[$request->script] ?? abort(404); - return response( - file_get_contents($scriptPath), + file_get_contents(LaRecipe::allScripts()[$request->script] ?? abort(404)), 200, ['Content-Type' => 'application/javascript'] ); diff --git a/src/Http/Controllers/StyleController.php b/src/Http/Controllers/StyleController.php index f952956..3b6ace8 100644 --- a/src/Http/Controllers/StyleController.php +++ b/src/Http/Controllers/StyleController.php @@ -13,10 +13,8 @@ class StyleController extends Controller */ public function __invoke(Request $request) { - $cssPath = LaRecipe::allStyles()[$request->style] ?? abort(404); - return response( - file_get_contents($cssPath), + file_get_contents(LaRecipe::allStyles()[$request->style] ?? abort(404)), 200, ['Content-Type' => 'text/css'] );