Gathering detailed insights and metrics for vary
Gathering detailed insights and metrics for vary
Gathering detailed insights and metrics for vary
Gathering detailed insights and metrics for vary
npm install vary
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
61 Stars
221 Commits
12 Forks
14 Watchers
9 Branches
25 Contributors
Updated on Jun 05, 2025
Latest Version
1.1.2
Package Id
vary@1.1.2
Size
3.68 kB
NPM Version
3.10.10
Node Version
6.11.1
Published on
Sep 24, 2017
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
Manipulate the HTTP Vary header
This is a Node.js module available through the
npm registry. Installation is done using the
npm install
command:
1$ npm install vary
1var vary = require('vary')
Adds the given header field
to the Vary
response header of res
.
This can be a string of a single field, a string of a valid Vary
header, or an array of multiple fields.
This will append the header if not already listed, otherwise leaves it listed in the current location.
1// Append "Origin" to the Vary header of the response 2vary(res, 'Origin')
Adds the given header field
to the Vary
response header string header
.
This can be a string of a single field, a string of a valid Vary
header,
or an array of multiple fields.
This will append the header if not already listed, otherwise leaves it listed in the current location. The new header string is returned.
1// Get header string appending "Origin" to "Accept, User-Agent" 2vary.append('Accept, User-Agent', 'Origin')
1var http = require('http') 2var vary = require('vary') 3 4http.createServer(function onRequest (req, res) { 5 // about to user-agent sniff 6 vary(res, 'User-Agent') 7 8 var ua = req.headers['user-agent'] || '' 9 var isMobile = /mobi|android|touch|mini/i.test(ua) 10 11 // serve site, depending on isMobile 12 res.setHeader('Content-Type', 'text/html') 13 res.end('You are (probably) ' + (isMobile ? '' : 'not ') + 'a mobile user') 14})
1$ npm test
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
6 different organizations found -- score normalized to 10
Details
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
no vulnerabilities detected
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
found 27 unreviewed changesets out of 30 -- score normalized to 1
Reason
branch protection not enabled on development/release branches
Details
Reason
0 out of 3 merged PRs checked by a CI test -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
no update tool detected
Details
Reason
project is not fuzzed
Details
Reason
0 commit(s) out of 30 and 0 issue activity out of 4 found in the last 90 days -- score normalized to 0
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Score
Last Scanned on 2024-08-12T21:25:28Z
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