/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-usage-in-combinatio-121a77c27666-usage-in-combination-with-secure-headers-docs-middleware-builtin-secure-heade-s0700-c0001.md
Usage in combination with [Secure Headers](/docs/middleware/builtin/s...
Usage in combination with Secure Headers middleware (2) Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms fu...
Usage in combination with Secure Headers middleware (2)
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#usage-in-combination-with-secure-headers-docs-middleware-builtin-secure-headers-middleware
Summary
## Content
```tsx{8,23}
import { secureHeaders, NONCE } from 'hono/secure-headers'
app.get(
'*',
secureHeaders({
contentSecurityPolicy: {
// Set the pre-defined nonce value to `styleSrc`:
styleSrc: [NONCE],
},
})
)
app.get('/', (c) => {
const headerClass = css`
background-color: orange;
color: white;
padding: 1rem;
`
return c.html(
<html>
<head>
{/* Set the `nonce` attribute on the CSS helpers `style` and `script` elements */}
<Style nonce={c.get('secureHeadersNonce')} />
</head>
<body>
<h1 class={headerClass}>Hello!</h1>
</body>
</html>
)
})