Add more detailed ERR_* error codes to common error messages

가장 많이 발생하는 '잘못된 요청입니다', '보안정책상 허용되지 않습니다'
오류에 좀더 구체적인 ERR_* 코드를 추가하여 디버깅 편의 개선
This commit is contained in:
Kijin Sung 2022-10-13 00:23:15 +09:00
parent b1eee629a2
commit e4e252c1b4
3 changed files with 25 additions and 24 deletions

View file

@ -374,12 +374,12 @@ class Session
$sso_request = Security::decrypt(\Context::get('sso_request'));
if (!$sso_request || !preg_match('!^https?://!', $sso_request))
{
\Context::displayErrorPage('SSO Error', 'Invalid SSO Request', 400);
\Context::displayErrorPage('SSO Error', 'ERR_INVALID_SSO_REQUEST', 400);
exit;
}
if (!URL::isInternalUrl($sso_request) || !URL::isInternalURL($_SERVER['HTTP_REFERER']))
{
\Context::displayErrorPage('SSO Error', 'Invalid SSO Request', 400);
\Context::displayErrorPage('SSO Error', 'ERR_INVALID_SSO_REQUEST', 400);
exit;
}
@ -400,14 +400,14 @@ class Session
$sso_response = Security::decrypt(\Context::get('sso_response'));
if ($sso_response === false)
{
\Context::displayErrorPage('SSO Error', 'Invalid SSO Response', 400);
\Context::displayErrorPage('SSO Error', 'ERR_INVALID_SSO_RESPONSE', 400);
exit;
}
// Check that the response was given by the default site (to prevent session fixation CSRF).
if(isset($_SERVER['HTTP_REFERER']) && !URL::isInternalURL($_SERVER['HTTP_REFERER']))
{
\Context::displayErrorPage('SSO Error', 'Invalid SSO Response', 400);
\Context::displayErrorPage('SSO Error', 'ERR_INVALID_SSO_RESPONSE', 400);
exit;
}