Skip to content
Snippets Groups Projects
Commit 9f7541fd authored by Rolf Niepraschk's avatar Rolf Niepraschk
Browse files

catch the error "ERR_STREAM_WRITE_AFTER_END"

parent e2a7ecd5
No related branches found
No related tags found
No related merge requests found
{
"name": "relayServer",
"version": "14.1.1",
"version": "14.1.2",
"description": "Nodejs-based http server for measurement tasks",
"main": "relayServer.js",
"directories": {
......
......@@ -41,8 +41,12 @@ function sendResponse(pRef, js, _data) {
'accept, authorization, content-type, origin, referer';
head['Access-Control-Allow-Credentials'] = true;
logger.debug('head: ', head);
pRef.res.writeHead(200, head);
pRef.res.end(data);
try {
pRef.res.writeHead(200, head);
pRef.res.end(data);
} catch(err) {
logger.debug('error: ', err.toString());
}
pRef.req.connection.end();
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment