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 <jviotti@openmailbox.org>
This commit is contained in:
Juan Cruz Viotti 2017-04-10 23:49:22 -04:00 committed by GitHub
parent fc46958ac0
commit 44094680fb
2 changed files with 3 additions and 0 deletions

View File

@ -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,

View File

@ -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: {