Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ruiquelhas committed Mar 30, 2016
1 parent 41b3193 commit 2d15b69
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If the validation fails, a [joi](https://github.com/hapijs/joi)-like `400 Bad Re
const Hapi = require('hapi');
const Copperfield = require('copperfield');

server = new Hapi.Server();
const server = new Hapi.Server();
server.connection({
// go nuts
});
Expand All @@ -38,7 +38,7 @@ const plugin = {
register: Copperfield,
options: {
// Allow png files only
whitelist: ['png']
whitelist: ['image/png']
}
};

Expand All @@ -62,7 +62,7 @@ server.register(plugin, (err) => {

## Supported File Types

The same as [magik](https://github.com/ruiquelhas/magik#supported-file-types).
The same as [file-type](https://github.com/sindresorhus/file-type#supported-file-types).

[coveralls-img]: https://coveralls.io/repos/ruiquelhas/copperfield/badge.svg
[coveralls-url]: https://coveralls.io/github/ruiquelhas/copperfield
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
"coveralls": "2.x.x",
"form-data": "0.x.x",
"hapi": "13.x.x",
"lab": "9.x.x",
"lab": "10.x.x",
"stream-to-promise": "1.x.x"
},
"dependencies": {
"houdin": "1.x.x",
"houdin": "2.x.x",
"supervizor": "1.x.x"
},
"engines": {
Expand Down
8 changes: 4 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ lab.experiment('copperfield', () => {
const setup = {
register: Copperfield,
options: {
whitelist: ['png']
whitelist: ['image/png']
}
};

Expand All @@ -43,10 +43,10 @@ lab.experiment('copperfield', () => {
lab.test('should return error if some file in the payload is not allowed', (done) => {

const png = Path.join(Os.tmpdir(), 'foo.png');
Fs.createWriteStream(png).end(new Buffer([0x89, 0x50]));
Fs.createWriteStream(png).end(new Buffer('89504e47', 'hex'));

const gif = Path.join(Os.tmpdir(), 'foo.gif');
Fs.createWriteStream(gif).end(new Buffer([0x47, 0x49]));
Fs.createWriteStream(gif).end(new Buffer('47494638', 'hex'));

const form = new FormData();
form.append('file1', Fs.createReadStream(gif));
Expand All @@ -73,7 +73,7 @@ lab.experiment('copperfield', () => {
lab.test('should return control to the server if all files the payload are allowed', (done) => {

const png = Path.join(Os.tmpdir(), 'foo.png');
Fs.createWriteStream(png).end(new Buffer([0x89, 0x50]));
Fs.createWriteStream(png).end(new Buffer('89504e47', 'hex'));

const form = new FormData();
form.append('file1', Fs.createReadStream(png));
Expand Down

0 comments on commit 2d15b69

Please sign in to comment.