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
99.2
Supply Chain
99.4
Quality
77.6
Maintenance
100
Vulnerability
100
License
Module System
Unable to determine the module system for this package.
Min. Node Version
Typescript Support
Node Version
NPM Version
61 Stars
219 Commits
9 Forks
16 Watching
3 Branches
26 Contributors
Updated on 19 Oct 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-3.1%
6,444,630
Compared to previous day
Last week
3.2%
35,123,900
Compared to previous week
Last month
11.2%
144,025,973
Compared to previous month
Last year
4.9%
1,514,475,267
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