Add security options to add X-Frame-Options and X-Content-Type-Options headers

- 보안 관련하여 널리 알려진 헤더 3종 가운데 2종을 기본 지원
- X-XSS-Protection 헤더는 IE 지원 종료로 불필요
This commit is contained in:
Kijin Sung 2023-06-18 23:33:41 +09:00
parent e3ce2bcbcc
commit 5ba6346bec
6 changed files with 66 additions and 15 deletions

View file

@ -115,6 +115,16 @@ class DisplayHandler extends Handler
}
}
// Print security-related headers.
if($header_value = config('security.x_frame_options'))
{
header('X-Frame-Options: ' . $header_value);
}
if($header_value = config('security.x_content_type_options'))
{
header('X-Content-Type-Options: ' . $header_value);
}
// flush output buffer
while (ob_get_level())
{