
Product
Introducing Pull Request Stories to Help Security Teams Track Supply Chain Risks
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
copperfield
Advanced tools
Server-level houdin validation for hapi.
Install via NPM.
$ npm install copperfield
Register the package as a server plugin to enable validation for each route that parses — parse: true
— and reads the request payload into memory — output: 'data'
. For every other route with a different configuration, the validation is skipped.
If the validation fails, a joi-like 400 Bad Request
error is returned alongside an additional content-validation: failure
response header. If everything is ok, the response will ultimately contain a content-validation: success
header.
const Hapi = require('hapi');
const Copperfield = require('copperfield');
try {
const server = new Hapi.Server();
await server.register({
plugin: Copperfield,
options: {
// Allow png files only
whitelist: ['image/png']
}
});
server.route({
options: {
payload: {
output: 'data',
parse: true
}
// go nuts
}
});
await server.start();
}
catch (err) {
throw err;
}
The same as file-type.
v4.0.0 (2017-11-07)
Closed issues:
Merged pull requests:
FAQs
Server-level houdin validation for hapi
We found that copperfield 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.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.