Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Set security headers

Implements a Cloudflare Worker to inject common security headers such as Content-Security-Policy, X-Frame-Options, and Strict-Transport-Security into HTTP responses.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Set security headers

Implements a Cloudflare Worker to inject common security headers such as Content-Security-Policy, X-Frame-Options, and Strict-Transport-Security into HTTP responses.

When To Use

Use when you need to implement a middleware pattern in Cloudflare Workers to automatically apply security headers to all outgoing HTTP responses.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-examples-security-headers-set-workflow-guide.mdA guide demonstrating how to implement common security headers like Content-Security-Policy and Strict-Transport-Security using Cloudflare Workers.Questions about a guide demonstrating how to implement common security headers like Content-Security-Policy and Strict-Transport-Secu...
examples/workers-examples-security-headers-set-cloudflare-workers-set-security-he.textA JavaScript example demonstrating how to intercept a fetch request in a Cloudflare Worker to inject security headers like Content-Security-Policy.Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to intercept a fetch request in a Cloudflare Worker to inject security headers...
examples/workers-examples-security-headers-set-cloudflare-workers-security-header.textA JavaScript example demonstrating how to intercept fetch requests in a Cloudflare Worker to inject security headers like Content-Security-Policy.Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to intercept fetch requests in a Cloudflare Worker to inject security headers...
examples/workers-examples-security-headers-set-cloudflare-workers-python-set-secu.textA Python implementation of a Cloudflare Worker that adds security headers like Content-Security-Policy to outgoing responses.Exact payloads, commands, or snippets shown in A Python implementation of a Cloudflare Worker that adds security headers like Content-Security-Policy to outgoing re...
examples/workers-examples-security-headers-set-cloudflare-workers-rust-set-securi.textA Rust implementation for a Cloudflare Worker that injects security headers like Content-Security-Policy into fetch responses using a HashMap.Exact payloads, commands, or snippets shown in A Rust implementation for a Cloudflare Worker that injects security headers like Content-Security-Policy into fetch r...
examples/workers-examples-security-headers-set-cloudflare-workers-hono-secure-hea.textA Hono framework implementation for Cloudflare Workers that applies security headers to all incoming requests.Exact payloads, commands, or snippets shown in A Hono framework implementation for Cloudflare Workers that applies security headers to all incoming requests.

What This Skill Covers

  • Set common security headers (X-XSS-Protection, X-Frame-Options, X-Content-Type-Options, Permissions-Policy, Referrer-Policy, Strict-Transport-Security, Conte...
  • Main sections: Tags.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/examples/security-headers