Skip to content

Opinionated defaults for API servers #550

Description

@IchordeDionysos

Hey,

the headers seem to be targeted more towards serving server-side rendered/served webpages.
While there is a use-case to lock down your pure NodeJS API servers with security headers.

I could see the following API surface using default targeted toward pure APIs:

app.use(
  helmet.apiDefaults()
)

Example headers (taken from GitHub API) could include (non-complete):

content-security-policy: default-src 'none'
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-content-type-options: nosniff
x-frame-options: deny
x-xss-protection: 0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions