diff --git a/src/applications/notification/client/PhabricatorNotificationClient.php b/src/applications/notification/client/PhabricatorNotificationClient.php index ae4b6a563b..132e76e3f8 100644 --- a/src/applications/notification/client/PhabricatorNotificationClient.php +++ b/src/applications/notification/client/PhabricatorNotificationClient.php @@ -2,7 +2,7 @@ final class PhabricatorNotificationClient { - const EXPECT_VERSION = 3; + const EXPECT_VERSION = 4; public static function getServerStatus() { $uri = PhabricatorEnv::getEnvConfig('notification.server-uri'); @@ -28,7 +28,7 @@ final class PhabricatorNotificationClient { public static function postMessage(array $data) { $server_uri = PhabricatorEnv::getEnvConfig('notification.server-uri'); - id(new HTTPSFuture($server_uri, $data)) + id(new HTTPSFuture($server_uri, json_encode($data))) ->setMethod('POST') ->setTimeout(1) ->resolvex(); diff --git a/support/aphlict/server/aphlict_server.js b/support/aphlict/server/aphlict_server.js index 8d1bd61a03..d7fc272d1c 100644 --- a/support/aphlict/server/aphlict_server.js +++ b/support/aphlict/server/aphlict_server.js @@ -63,7 +63,6 @@ if (process.getuid() !== 0) { var net = require('net'); var http = require('http'); var url = require('url'); -var querystring = require('querystring'); process.on('uncaughtException', function (err) { debug.log("\n<<< UNCAUGHT EXCEPTION! >>>\n\n" + err); @@ -121,7 +120,7 @@ var receive_server = http.createServer(function(request, response) { request.on('end', function () { ++messages_in; - var data = querystring.parse(body); + var data = JSON.parse(body); debug.log('notification: ' + JSON.stringify(data)); broadcast(data); response.end(); @@ -140,7 +139,7 @@ var receive_server = http.createServer(function(request, response) { 'messages.in': messages_in, 'messages.out': messages_out, 'log': config.log, - 'version': 3 + 'version': 4 }; response.write(JSON.stringify(status));