secureHeaderEntries
The headers added to every response, as name-value pairs, for the given options.
The headers added to every response, as name-value pairs, for the given options. A value of
false omits the header. HSTS is added only when secure (the request came over https).
Import#
ts
import { secureHeaderEntries } from "@shadow-js/dusk/server";
Signature#
ts
function secureHeaderEntries(
options: SecureHeadersOptions | undefined,
secure: boolean,
): Array<readonly [string, string]>
Parameters#
| Name | Description |
|---|---|
options |
Overrides. |
secure |
Whether the request used https. |
Returns#
The headers to set (unless the response already has them).
Examples#
ts
secureHeaderEntries(undefined, true); // [["x-content-type-options", "nosniff"], ...]