From 617999afdadfa0c8c04d88a27bbba5210119a613 Mon Sep 17 00:00:00 2001 From: Lars Willighagen Date: Fri, 5 Oct 2018 01:52:42 +0200 Subject: [PATCH 1/2] fix(config): add more ssri config options See: 10d5d9a8c2d42217e12eb16619ba9cc2f5751364 --- put.js | 1 + 1 file changed, 1 insertion(+) diff --git a/put.js b/put.js index 01b0dd8..25cace2 100644 --- a/put.js +++ b/put.js @@ -20,6 +20,7 @@ const PutOpts = figgyPudding({ gid: {}, single: {}, sep: {}, + error: {}, strict: {} }) From fbdb13e8c49e71524ade2174ec0c515d4c3c8d98 Mon Sep 17 00:00:00 2001 From: Lars Willighagen Date: Fri, 5 Oct 2018 01:53:59 +0200 Subject: [PATCH 2/2] test(write): integrity error test case --- test/put.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/put.js b/test/put.js index ac182f9..35ed4c6 100644 --- a/test/put.js +++ b/test/put.js @@ -102,6 +102,16 @@ test('optionally memoizes data on stream insertion', t => { }) }) +test('errors if integrity errors', t => { + return BB.join( + put(CACHE, KEY, CONTENT, { + integrity: 'sha1-BaDDigEST' + }).catch(err => { + t.equal(err.code, 'EINTEGRITY', 'got error from bad integrity') + }) + ) +}) + test('signals error if error writing to cache', t => { return BB.join( put(CACHE, KEY, CONTENT, {