Check if response is stream or object without using reference to reflection package.

This commit is contained in:
Niclas Emdelius
2016-12-21 12:15:39 +01:00
committed by Steve Sanderson
parent 0907379da8
commit 49bece54c2

View File

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