diff --git a/src/content/docs/ko/guides/deploy/cleavr.mdx b/src/content/docs/ko/guides/deploy/cleavr.mdx index 2c80119bfcf0c..b36282050eb4f 100644 --- a/src/content/docs/ko/guides/deploy/cleavr.mdx +++ b/src/content/docs/ko/guides/deploy/cleavr.mdx @@ -8,6 +8,7 @@ logo: cleavr supports: ['ssr', 'static'] i18nReady: true --- + import { Steps } from '@astrojs/starlight/components'; 서버 및 앱 배포 관리 도구인 [Cleavr](https://cleavr.io/)을 사용하여 Astro 프로젝트를 자체 VPS (Virtual Private Server)에 배포할 수 있습니다. diff --git a/src/content/docs/ko/reference/experimental-flags/csp.mdx b/src/content/docs/ko/reference/experimental-flags/csp.mdx index 6ac895111de4a..4c39048b69bf9 100644 --- a/src/content/docs/ko/reference/experimental-flags/csp.mdx +++ b/src/content/docs/ko/reference/experimental-flags/csp.mdx @@ -188,7 +188,7 @@ export default defineConfig({ ``` -### 하위 클래스 값 추가하기 +##### 하위 클래스 값 추가하기 이 필드를 사용하여 [`script-src-attr`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/script-src-attr), [`script-src-elem`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/script-src-elem), [`style-src-attr`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/style-src-attr), [`style-src-elem`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/style-src-elem)에 속하는 유효한 값 (예: `unsafe-hashes` 및 `unsafe-inline`)을 추가할 수도 있습니다. @@ -229,6 +229,48 @@ export default defineConfig({ ``` +##### 다중 리소스 + +리소스를 여러 번 또는 여러 소스 (예: `csp` 구성에 정의된 것과 [CSP 런타임 API](#런타임-api)를 사용하여 추가된 것)로부터 삽입할 때, Astro는 중복을 제거하고 새로운 리소스들을 병합합니다. + +다음 예시에서 `img-src https://global.cdn.example.org` 및 `default-src https://global.cdn.example.org` 지시어는 `csp` 구성에 설정되어 모든 페이지에 적용됩니다. + +```js title="astro.config.mjs" +export default defineConfig({ + experimental: { + csp: { + directives: [ + "img-src https://global.cdn.example.org", + "default-src https://global.cdn.example.org" + ] + } + } +}) +``` + +또한, 개별 페이지에서는 [Astro.csp.insertDirective](#cspinsertdirective)를 사용하여 `img-src https://vendor.cdn.example.org/` 및 `default-src https://global.cdn.example.org/ https://vendor.cdn.example.org/` 리소스가 추가됩니다. + +```astro title="src/pages/index.astro" +--- +Astro.csp.insertDirective("img-src https://vendor.cdn.example.org") +Astro.csp.insertDirective("default-src https://global.cdn.example.org https://vendor.cdn.example.org") +--- +``` + +빌드 과정에서 `index.html` 페이지에 대한 `image-src` 및 `default-src` 지시어의 리소스는 병합되고 중복이 제거되어 적절한 헤더를 생성합니다. + +```html + + + +``` + #### `hashes`