0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

docs: update security.checkOrigin JSDoc comment (#12011)

This commit is contained in:
Armand Philippot 2024-09-16 22:27:22 +02:00 committed by GitHub
parent f10a3b7fe6
commit cfdaab257c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fixes a type and an example in documenting the `security.checkOrigin` property of Astro config.

View file

@ -442,8 +442,8 @@ export interface AstroUserConfig {
/**
* @docs
* @name security
* @type {boolean}
* @default `{}`
* @type {Record<"checkOrigin", boolean> | undefined}
* @default `{checkOrigin: true}`
* @version 4.9.0
* @description
*
@ -451,12 +451,16 @@ export interface AstroUserConfig {
*
* These features only exist for pages rendered on demand (SSR) using `server` mode or pages that opt out of prerendering in `static` mode.
*
* By default, Astro will automatically check that the origin header
* matches the URL sent by each request in on-demand rendered pages. You can
* disable this behavior by setting `checkOrigin` to `false`:
*
* ```js
* // astro.config.mjs
* export default defineConfig({
* output: "server",
* security: {
* checkOrigin: true
* checkOrigin: false
* }
* })
* ```