From 44094680fb199e423463abe0908fbad53d0fd4a4 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Mon, 10 Apr 2017 23:49:22 -0400 Subject: [PATCH] fix(image-stream): return a path from the handler (#1278) The `application/x-apple-diskimage` handler doesn't return a path, causing an issue when fetching the image metadata, and trying using the path to determine if its a supported image type. Change-Type: patch Changelog-Entry: Fix "Path must be a string. Received undefined" when selecting Apple images. Signed-off-by: Juan Cruz Viotti --- lib/image-stream/handlers.js | 1 + tests/image-stream/dmg.spec.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/image-stream/handlers.js b/lib/image-stream/handlers.js index fbe2b9c3..16353c4f 100644 --- a/lib/image-stream/handlers.js +++ b/lib/image-stream/handlers.js @@ -142,6 +142,7 @@ module.exports = { 'application/x-apple-diskimage': (file, options) => { return udif.getUncompressedSizeAsync(file).then((size) => { return { + path: file, stream: udif.createReadStream(file), size: { original: options.size, diff --git a/tests/image-stream/dmg.spec.js b/tests/image-stream/dmg.spec.js index 1d7c19fa..4f0d92da 100644 --- a/tests/image-stream/dmg.spec.js +++ b/tests/image-stream/dmg.spec.js @@ -50,6 +50,7 @@ describe('ImageStream: DMG', function() { return imageStream.getImageMetadata(image).then((metadata) => { m.chai.expect(metadata).to.deep.equal({ + path: image, size: { original: compressedSize, final: { @@ -86,6 +87,7 @@ describe('ImageStream: DMG', function() { return imageStream.getImageMetadata(image).then((metadata) => { m.chai.expect(metadata).to.deep.equal({ + path: image, size: { original: compressedSize, final: {