mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Support streamed response from HttpNodeInstance
This commit is contained in:
@@ -42,6 +42,19 @@ var server = http.createServer(function(req, res) {
|
||||
}
|
||||
};
|
||||
|
||||
// Support streamed responses
|
||||
Object.defineProperty(callback, 'stream', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
if (!hasSentResult) {
|
||||
hasSentResult = true;
|
||||
res.setHeader('Content-Type', 'application/octet-stream');
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
func.apply(null, [callback].concat(bodyJson.args));
|
||||
} catch (synchronousException) {
|
||||
|
||||
Reference in New Issue
Block a user