1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-19 16:58:48 +02:00

Don't hang on /status/ for newer Node

Summary: At some point, Node started requiring us to read data before we can get the 'end' event, it seems. Fixes T2953.

Test Plan: Ran server in `--foreground` mode on node v0.11.0, made request to `/status/`, got response.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2953

Differential Revision: https://secure.phabricator.com/D5666
This commit is contained in:
epriestley 2013-04-11 15:45:50 -07:00
parent 7b9b872b29
commit 2b8adb3a83

View file

@ -182,6 +182,11 @@ var receive_server = http.createServer(function(request, response) {
response.end();
});
} else if (request.url == '/status/') {
request.on('data', function(data) {
// We just ignore the request data, but newer versions of Node don't
// get to 'end' if we don't process the data. See T2953.
});
request.on('end', function() {
var status = {
'uptime': (new Date().getTime() - start_time),