From 49bece54c282b0a2b07afbb02754e4cb2e951c6c Mon Sep 17 00:00:00 2001 From: Niclas Emdelius Date: Wed, 21 Dec 2016 12:15:39 +0100 Subject: [PATCH] Check if response is stream or object without using reference to reflection package. --- .../HostingModels/HttpNodeInstance.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.AspNetCore.NodeServices/HostingModels/HttpNodeInstance.cs b/src/Microsoft.AspNetCore.NodeServices/HostingModels/HttpNodeInstance.cs index 5bdad1ef71..8beea51f70 100644 --- a/src/Microsoft.AspNetCore.NodeServices/HostingModels/HttpNodeInstance.cs +++ b/src/Microsoft.AspNetCore.NodeServices/HostingModels/HttpNodeInstance.cs @@ -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).GetTypeInfo().IsAssignableFrom(typeof(Stream).GetTypeInfo())) + if (typeof(T) != typeof(Stream) && typeof(T) != typeof(object)) { throw new ArgumentException( "Node module responded with binary stream. This cannot be converted to the requested generic type: " +