Gathering detailed insights and metrics for on-headers
Gathering detailed insights and metrics for on-headers
Gathering detailed insights and metrics for on-headers
Gathering detailed insights and metrics for on-headers
@types/on-headers
TypeScript definitions for on-headers
expo-structured-headers
Expo module implementation of a parser based on https://httpwg.org/specs/rfc8941.html
haraka-plugin-headers
Haraka plugin that performs tests on email headers
@api-components/api-headers-document
Documentation component for API headers based on AMF data model
npm install on-headers
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
157 Stars
190 Commits
26 Forks
14 Watchers
10 Branches
24 Contributors
Updated on Jul 11, 2025
Latest Version
1.0.2
Package Id
on-headers@1.0.2
Size
3.15 kB
NPM Version
6.4.1
Node Version
8.15.0
Published on
Feb 22, 2019
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Execute a listener when a response is about to write headers.
This is a Node.js module available through the
npm registry. Installation is done using the
npm install
command:
1$ npm install on-headers
1var onHeaders = require('on-headers')
This will add the listener listener
to fire when headers are emitted for res
.
The listener is passed the response
object as it's context (this
). Headers are
considered to be emitted only once, right before they are sent to the client.
When this is called multiple times on the same res
, the listener
s are fired
in the reverse order they were added.
1var http = require('http') 2var onHeaders = require('on-headers') 3 4http 5 .createServer(onRequest) 6 .listen(3000) 7 8function addPoweredBy () { 9 // set if not set by end of request 10 if (!this.getHeader('X-Powered-By')) { 11 this.setHeader('X-Powered-By', 'Node.js') 12 } 13} 14 15function onRequest (req, res) { 16 onHeaders(res, addPoweredBy) 17 18 res.setHeader('Content-Type', 'text/plain') 19 res.end('hello!') 20}
1$ npm test
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
3 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 3
Reason
Found 6/30 approved changesets -- score normalized to 2
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More