Skip to content

Commit 0907379

Browse files
nicemdSteveSandersonMS
authored andcommitted
Streamed responses can be be Object or Stream
See issue aspnet#518
1 parent fbb8054 commit 0907379

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Microsoft.AspNetCore.NodeServices/HostingModels/HttpNodeInstance.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ protected override async Task<T> InvokeExportAsync<T>(
9191

9292
case "application/octet-stream":
9393
// Streamed responses have to be received as System.IO.Stream instances
94-
if (typeof(T) != typeof(Stream))
94+
if (!typeof(T).GetTypeInfo().IsAssignableFrom(typeof(Stream).GetTypeInfo()))
9595
{
9696
throw new ArgumentException(
9797
"Node module responded with binary stream. This cannot be converted to the requested generic type: " +
@@ -136,4 +136,4 @@ protected override void Dispose(bool disposing)
136136
}
137137
}
138138
}
139-
}
139+
}

0 commit comments

Comments
 (0)