Streamed responses can be be Object or Stream

See issue https://github.com/aspnet/JavaScriptServices/issues/518
This commit is contained in:
nicemd 2016-12-16 15:12:04 +01:00 committed by Steve Sanderson
parent fbb8054c2e
commit 0907379da8
1 changed files with 2 additions and 2 deletions

View File

@ -91,7 +91,7 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels
case "application/octet-stream":
// Streamed responses have to be received as System.IO.Stream instances
if (typeof(T) != typeof(Stream))
if (!typeof(T).GetTypeInfo().IsAssignableFrom(typeof(Stream).GetTypeInfo()))
{
throw new ArgumentException(
"Node module responded with binary stream. This cannot be converted to the requested generic type: " +
@ -136,4 +136,4 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels
}
}
}
}
}