diff --git a/app/app.php b/app/app.php index e22d5dc24..a438950f3 100644 --- a/app/app.php +++ b/app/app.php @@ -86,7 +86,7 @@ $utopia->init(function () use ($utopia, $request, $response, &$user, $project, $ //->addHeader('X-Frame-Options', ($refDomain == 'http://localhost') ? 'SAMEORIGIN' : 'ALLOW-FROM ' . $refDomain) ->addHeader('X-Content-Type-Options', 'nosniff') ->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE') - ->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-SDK-Version') + ->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-SDK-Version, Cache-Control, Expires, Pragma') ->addHeader('Access-Control-Expose-Headers', 'X-Fallback-Cookies') ->addHeader('Access-Control-Allow-Origin', $refDomain) ->addHeader('Access-Control-Allow-Credentials', 'true') @@ -246,7 +246,7 @@ $utopia->options(function () use ($request, $response) { $response ->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE') - ->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-SDK-Version, X-Fallback-Cookies') + ->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-SDK-Version, Cache-Control, Expires, Pragma, X-Fallback-Cookies') ->addHeader('Access-Control-Expose-Headers', 'X-Fallback-Cookies') ->addHeader('Access-Control-Allow-Origin', $origin) ->addHeader('Access-Control-Allow-Credentials', 'true') diff --git a/app/controllers/shared/web.php b/app/controllers/shared/web.php index 9f148817a..42afb283e 100644 --- a/app/controllers/shared/web.php +++ b/app/controllers/shared/web.php @@ -31,7 +31,7 @@ $layout ->setParam('env', $utopia->getEnv()) ; -$utopia->shutdown(function () use ($utopia, $response, $request, $layout) { +$utopia->init(function () use ($utopia, $response, $request, $layout) { $time = (60 * 60 * 24 * 45); // 45 days cache $isDev = (\Utopia\App::ENV_TYPE_DEVELOPMENT == Config::getParam('env')); diff --git a/app/controllers/web/console.php b/app/controllers/web/console.php index 70f32693f..4e9bd78fc 100644 --- a/app/controllers/web/console.php +++ b/app/controllers/web/console.php @@ -183,7 +183,7 @@ $utopia->get('/console/database/collection') ->label('permission', 'public') ->label('scope', 'console') ->param('id', '', function () { return new UID(); }, 'Collection unique ID.') - ->action(function ($id) use ($layout, $projectDB) { + ->action(function ($id) use ($response, $layout, $projectDB) { Authorization::disable(); $collection = $projectDB->getDocument($id, false); Authorization::reset(); @@ -197,10 +197,18 @@ $utopia->get('/console/database/collection') $page ->setParam('collection', $collection) ; - + $layout ->setParam('title', APP_NAME.' - Database Collection') - ->setParam('body', $page); + ->setParam('body', $page) + ; + + $response + ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') + ->addHeader('Expires', 0) + ->addHeader('Pragma', 'no-cache') + ; + }); $utopia->get('/console/database/document') diff --git a/docker/nginx.conf b/docker/nginx.conf index 356eaa833..b1a569029 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -107,12 +107,6 @@ http { add_header Cache-Control "public"; } - location /proxy.html { - expires 1y; - access_log off; - add_header Cache-Control "public"; - } - #error_page 404 /404.html; # redirect server error pages to the static page /50x.html