فهرست منبع

[Fix] write after end ?

B Thibault 8 سال پیش
والد
کامیت
e4804d8cae
1فایلهای تغییر یافته به همراه2 افزوده شده و 6 حذف شده
  1. 2 6
      srv/src/httpServ.js

+ 2 - 6
srv/src/httpServ.js

@@ -151,16 +151,12 @@ Server.prototype.onRequest = function(req, res) {
                             res.writeHeader("403", {
                                 "Content-Type": "application/json"
                             });
-                            res.write(slack.error, () => {
-                                res.end();
-                            });
+                            res.end(slack.error);
                         } else {
                             res.writeHeader("200", {
                                 "Content-Type": "application/json"
                             });
-                            res.write(JSON.stringify(newData), () => {
-                                res.end();
-                            });
+                            res.end(JSON.stringify(newData));
                         }
                     } catch (e) {}
                 }