You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2019/12/12 23:03:23 UTC

[mesos] branch master updated: Updated /quota GET handler to use jsonify.

This is an automated email from the ASF dual-hosted git repository.

bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new b7a7f66  Updated /quota GET handler to use jsonify.
b7a7f66 is described below

commit b7a7f66ff8908bbefc8f2193ee93d8ae86ee516e
Author: Benjamin Mahler <bm...@apache.org>
AuthorDate: Thu Dec 12 17:50:10 2019 -0500

    Updated /quota GET handler to use jsonify.
    
    This is not only more efficient (no temporary object construction),
    but it's now convention to prefer jsonify over json object
    construction.
---
 src/master/quota_handler.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/master/quota_handler.cpp b/src/master/quota_handler.cpp
index 9cfe76b..ea3f858 100644
--- a/src/master/quota_handler.cpp
+++ b/src/master/quota_handler.cpp
@@ -351,7 +351,8 @@ Future<http::Response> Master::QuotaHandler::status(
 
   return _status(principal)
     .then([request](const QuotaStatus& status) -> Future<http::Response> {
-      return OK(JSON::protobuf(status), request.url.query.get("jsonp"));
+      return OK(jsonify(JSON::Protobuf(status)),
+                request.url.query.get("jsonp"));
     });
 }