Przeglądaj źródła

check that res has not already been sent before sending catch 500

Henry Oswald 12 lat temu
rodzic
commit
e8b245e857
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      services/filestore/app.coffee

+ 2 - 1
services/filestore/app.coffee

@@ -35,7 +35,8 @@ app.use (req, res, next) ->
 	requestDomain.add req
 	requestDomain.add res
 	requestDomain.on "error", (err)->
-		res.send 500
+		if !res.finished
+			res.send(500)
 		logger = require('logger-sharelatex')
 		req =
 			body:req.body