세션·로그인 제한, ZIP/업로드 스트리밍, CSP 최소 강제와 Report-Only, Playwright 격리 검증을 추가하고 미디어 목록을 reconcile 후 database 모드로 고정한다. Co-authored-by: Cursor <cursoragent@cursor.com>
15 lines
447 B
JavaScript
15 lines
447 B
JavaScript
import { getRequestURL } from 'h3'
|
|
import { applySecurityHeaders } from '../utils/security-headers.js'
|
|
|
|
/**
|
|
* 모든 응답에 브라우저 기본 보안 헤더를 적용한다.
|
|
* @param {import('h3').H3Event} event - 요청 이벤트
|
|
* @returns {void}
|
|
*/
|
|
export default defineEventHandler((event) => {
|
|
const pathname = getRequestURL(event).pathname
|
|
applySecurityHeaders(event, {
|
|
enforceCsp: !/^\/pages(?:\/|$)/.test(pathname)
|
|
})
|
|
})
|