diff --git a/.gitignore b/.gitignore index 72a04b8bae..c9e69cf7d4 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ build node_modules client test.php +main.html diff --git a/application/Espo/Core/Application.php b/application/Espo/Core/Application.php index 40937c6d96..603fdb9547 100644 --- a/application/Espo/Core/Application.php +++ b/application/Espo/Core/Application.php @@ -1,4 +1,4 @@ -getSlim()->hook('slim.after.router', function () use (&$slim) { $slim->contentType('application/json'); + + $res = $slim->response(); + $res->header('Expires', '0'); + $res->header('Last-Modified', gmdate("D, d M Y H:i:s") . " GMT"); + $res->header('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); + $res->header('Pragma', 'no-cache'); }); } diff --git a/application/Espo/Core/Utils/Api/Auth.php b/application/Espo/Core/Utils/Api/Auth.php index beeb952142..1b853a60e5 100644 --- a/application/Espo/Core/Utils/Api/Auth.php +++ b/application/Espo/Core/Utils/Api/Auth.php @@ -1,4 +1,4 @@ -headers('PHP_AUTH_USER'); - $authSec = $req->headers('PHP_AUTH_PW'); + $authSec = $req->headers('PHP_AUTH_PW'); + + $espoAuth = $req->headers('HTTP_ESPO_AUTHORIZATION'); + if (isset($espoAuth)) { + $credentials = explode(':', base64_decode($espoAuth)); + $authKey = $credentials[0]; + $authSec = $credentials[1]; + } if ($authKey && $authSec) { $isAuthenticated = false;