Update various controllers and scripts; modify last modified dates, enhance JSON responses, and adjust PPN handling for improved functionality
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
Desc. : Loading Routing Setup
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : November 23rd, 2019.
|
||||
Last Modified : October 21st, 2026.
|
||||
Last Modified : November 4th, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
@@ -130,8 +130,11 @@ $router->group('', function(Router $router) use ($app, $session, $config) {
|
||||
$mimeType = 'application/octet-stream';
|
||||
if (str_ends_with($filePath, '.js')) $mimeType = 'application/javascript';
|
||||
if (str_ends_with($filePath, '.css')) $mimeType = 'text/css';
|
||||
$app->response()->header('Content-Type', $mimeType);
|
||||
echo file_get_contents($filePath);
|
||||
$app->response()->header('Content-Type', $mimeType.'; charset=utf-8');
|
||||
if (function_exists('gzencode') && str_contains($_SERVER['HTTP_ACCEPT_ENCODING'] ?? '', 'gzip')) {
|
||||
$app->response()->header('Content-Encoding', 'gzip');
|
||||
echo gzencode(file_get_contents($filePath), 9);
|
||||
} else echo file_get_contents($filePath);
|
||||
} else {
|
||||
$app->notFound();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user