Public Source Viewer
비나래아카이브 개발자 포털
실제 서비스 구조를 살펴볼 수 있는 공개용 코드 뷰어입니다. 인증, 세션, 외부 연동, 토큰, 관리자 식별 등 보안상 민감한 구현은 파일 단위 또는 줄 단위로 검열됩니다.
src/config/sanitize.config.ts
공개 가능
1
export const sanitizeOptions: any = {
2
allowedTags: [
3
'b', 'i', 'em', 'strong', 'a',
4
'p', 'ul', 'ol', 'li', 'br', 'span',
5
'img', 'code', 'pre', 'blockquote'
6
],
7
allowedAttributes: {
8
'a': ['href', 'target', 'rel'],
9
'img': ['src', 'alt', 'width', 'height', 'class'],
10
'*': ['style']
11
},
12
allowedSchemes: ['http', 'https', 'data'],
13
transformTags: {
14
'img': (tagName: string, attribs: any) => {
15
const src = attribs.src || '';
16
17
if (!src.startsWith('/uploads/') && !src.includes('/uploads/')) {
18
return {
19
tagName: 'span',
20
attribs: {},
21
text: '[외부 이미지 차단됨]'
22
};
23
}
24
25
return {
26
tagName: 'img',
27
attribs
28
};
29
}
30
}
31
};
32