# cloudflare

> Cloudflare Pages and Workers: valid headers and redirects files, current binding types, and security rules for worker code.

Cloudflare Pages and Workers: valid headers and redirects files, current binding types, and security rules for worker code. It requires [`javascript`](/reference/configurations/javascript/).

## Checks

| Check                                                                 | Stage    | Level         | What it does                                                                                                                                                                      |
| --------------------------------------------------------------------- | -------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`cloudflare/headers`](/reference/checks/cloudflare/headers/)         | `commit` | `recommended` | Checks that `_headers` holds only blocks of a path followed by indented name-value lines, and that the block for every path sets the content type, referrer, and framing headers. |
| [`cloudflare/redirects`](/reference/checks/cloudflare/redirects/)     | `commit` | `recommended` | Checks each redirect source, destination, and optional status: 200, 301, 302, 303, 307, or 308, without a force suffix.                                                           |
| [`cloudflare/stale-types`](/reference/checks/cloudflare/stale-types/) | `push`   | `recommended` | Checks that a tracked environment types file matches what wrangler writes.                                                                                                        |

## Settings

| Setting                                                                           | What it sets                                                                      |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| [`cloudflare.types_file`](/reference/gspot-toml/#cloudflare.types_file)           | Tracked Worker environment types file, relative to the repository root.           |
| [`cloudflare.types_interface`](/reference/gspot-toml/#cloudflare.types_interface) | Environment interface name passed to wrangler types; OpenNext uses CloudflareEnv. |

## Selected when

gspot selects it in a scope with filenames `wrangler.toml`, `wrangler.json`, `wrangler.jsonc`, `_worker.js`, or dependencies `wrangler`, `@opennextjs/cloudflare`, or file paths `**/functions/_middleware.{js,ts}`.

## Rules for coding agents

| Rule file                                                       | Installed when |
| --------------------------------------------------------------- | -------------- |
| `.gspot/configurations/platform/cloudflare/rules/CLOUDFLARE.md` | Always         |

## Tools and versions

| Tool     | Version |
| -------- | ------- |
| wrangler | Any     |

## Files gspot writes

gspot writes `.gspot/configurations/platform/cloudflare/semgrep.yml` (with the [`security`](/reference/configurations/security/) configuration).
