Skip to content
Meeko
Type to search the guides and the API reference. Open it from any page with / or Ctrl K; move with the arrow keys and open a result with Enter.
Get started

Contents

On this page

Not translated yet

This page has not been translated into English yet, so it is shown in Spanish.

ServerResponseConfig

interfaz Since 1.7.0

Cabeceras de respuesta de los adaptadores con servidor (node, bun, deno y cloudflare). Se fijan en el build y se aplican en producción (meeko start y las salidas de cada adaptador), no en meeko dev.

ts
import type { ServerResponseConfig } from "@meekojs/meeko/build";

Source code src/modules/define-meeko-config.ts:63

Declaración #

ts
interface ServerResponseConfig {
	readonly contentSecurityPolicy?: ContentSecurityPolicy
	readonly headers?: ServerHeaders
}

Example #

ts
import type { ServerResponseConfig } from "@meekojs/meeko/framework";

const response: ServerResponseConfig = {
  contentSecurityPolicy: { "default-src": ["'self'"], "object-src": ["'none'"], "base-uri": ["'none'"] },
  headers: { "X-Content-Type-Options": "nosniff" },
};

Propiedades #

contentSecurityPolicy #

propiedad sólo lectura opcional since 1.7.0

readonly contentSecurityPolicy?: ContentSecurityPolicy

Política Content-Security-Policy, por directiva. Meeko le añade, según la respuesta: los hashes del build en una página prerenderizada; un nonce por petición en una página SSR; los hashes de su HTML en una página SSR con cache, y default-src 'none'; frame-ancestors 'none' sustituye a la política en el JSON de API, RPC y navegación. Nunca añade un nonce ni un hash a una directiva con 'unsafe-inline'.

headers #

propiedad sólo lectura opcional since 1.7.0

readonly headers?: ServerHeaders

Otras cabeceras, globales o por patrón de ruta (véase ServerHeaders). Content-Security-Policy no se admite aquí: use contentSecurityPolicy.

See also #

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters

Edit on GitHub: packages/meeko/src/modules/define-meeko-config.ts