
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
unplugin-cloudflare-headers
Advanced tools
Generates cloudflare compatible headers with _headers file
npm i unplugin-cloudflare-headers
Vite
// vite.config.ts
import CloudflareHeaders from 'unplugin-cloudflare-headers/vite'
export default defineConfig({
plugins: [
CloudflareHeaders({ /* options */ }),
],
})
// rollup.config.js
import CloudflareHeaders from 'unplugin-cloudflare-headers/rollup'
export default {
plugins: [
CloudflareHeaders({ /* options */ }),
],
}
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-cloudflare-headers/webpack')({ /* options */ })
]
}
// esbuild.config.js
import { build } from 'esbuild'
import CloudflareHeaders from 'unplugin-cloudflare-headers/esbuild'
build({
plugins: [CloudflareHeaders()],
})
Top level keys of the options are route definitions. Each route should have an array of headers. Header is simple object, where key is header name and value (string or false) is header value. Let's see example.
This options:
const options = {
'/*': [{ 'x-testing': 'hello 🌐' }],
'/admin': [{ 'x-testing': false }]
// use `false` as header value to detach header from specific route
}
will result into this _headers file:
/*
x-testing: hello 🌐
/admin
! x-testing
More on _headers file in cloudflare docs
License MIT
FAQs
Generates cloudflare compatible headers with _headers file
We found that unplugin-cloudflare-headers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.