
Product
PHP and Composer Support Is Now in Beta
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.
@fastify/accept-negotiator
Advanced tools
A negotiator for accept-* headers.
npm i @fastify/accept-negotiator
The module exports a function that you can use for negotiating an accept-* header such as accept-encoding. It takes 2 parameters:
negotiate(header, supportedValues)
header (string, required) - The accept-header, e.g. accept-encodingsupportedValues (string[], required) - The values, which are supportedconst negotiate = require('@fastify/accept-negotiator').negotiate
const encoding = negotiate('gzip, deflate, br', ['br'])
console.log(encoding) // 'br*
The module also exports a class that you can use for negotiating an accept-* header, and use caching for better performance.
Negotiate(supportedValues)
supportedValues (string[], required) - The values, which are supportedcache ({ set: Function; get: Function; has: Function }, optional) - A Cache-Store, e.g. ES6-Map or mnemonist LRUCacheconst Negotiator = require('@fastify/accept-negotiator').Negotiator
const encodingNegotiator = new Negotiator({ supportedValues: ['br'], cache: new Map() })
const encoding = encodingNegotiator.negotiate('gzip, deflate, br')
console.log(encoding) // 'br*
Licensed under MIT.
FAQs
a negotiator for the accept-headers
The npm package @fastify/accept-negotiator receives a total of 2,547,731 weekly downloads. As such, @fastify/accept-negotiator popularity was classified as popular.
We found that @fastify/accept-negotiator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.

Product
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.

Product
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.

Research
/Security News
Three compromised Rust crates pulled in a malicious dependency that downloaded and executed cross-platform malware during Cargo builds.