1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-06-05 22:09:38 +02:00

Introduzione procedura di inizializzazione

This commit is contained in:
Dasc3er
2021-02-19 14:39:39 +01:00
parent b93ee1a7f6
commit 2f2e59e325
73 changed files with 916 additions and 371 deletions

View File

@@ -12,7 +12,7 @@ class LegacyController extends Controller
{
public function index($path = 'index.php')
{
$base_path = base_path('legacy/');
$base_path = base_path('legacy');
$file = realpath($base_path.'/'.$path);
if (strpos($file, $base_path) === false) {
throw new NotFoundHttpException();
@@ -28,6 +28,13 @@ class LegacyController extends Controller
$output = ob_get_clean();
return new Response($output);
$response = response($output);
// Fix content-type per contenuti non HTML
if (ends_with($path, '.js')) {
$response = $response->header('Content-Type', 'application/javascript');
}
return $response;
}
}