Skip to content

Commit

Permalink
fix(h5test): deal with res headersSent after fail
Browse files Browse the repository at this point in the history
  • Loading branch information
huangyoukun committed Jul 5, 2018
1 parent 905f218 commit 4608393
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/tsw/util/h5-test/is-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ module.exports.isTestUser = function(req, res) {
}).done(function(d) {
}).fail(function(d) {
logger.error('h5test proxy fail...');
if (res.headersSent) {
res.end();
return;
}
res.setHeader('Content-Type', 'text/html; charset=UTF-8');
res.writeHead(500);
res.end();
Expand Down

0 comments on commit 4608393

Please sign in to comment.