/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>
  )
})
Kinic Wiki
Loading knowledge node
Details

Identity

database
db_23dhmsxlhukv
database_id
db_23dhmsxlhukv
path
/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
kind
directory
role
markdown_note
children
0

Metadata

created_at
virtual
updated_at
virtual
etag
virtual
metadata_json
{}

Lint Hints

No lightweight warnings.

Outgoing Links

No outgoing links indexed.

Incoming Links

Select a file node to inspect backlinks.

Raw Source

No raw source path inferred.