I have a simple server in node.js that runs external commands. Theses commands already provide the correct Content-type header:
exec(filename, {env: process.env}, function (error, stdout, stderr) {
res.write(stdout);
res.end();
});
If I do that, node will set Content-type to 'text/plain'. I could parse stdout to get the Content-type but I wonder if there is another way of doing this. Thanks!