Repository: mesos Updated Branches: refs/heads/master f15bf085d -> 547d911a7
Added a NotAcceptable HTTP Response. Review: https://reviews.apache.org/r/35934 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/547d911a Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/547d911a Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/547d911a Branch: refs/heads/master Commit: 547d911a76544031ebfa6e2681a536bbd321f5d8 Parents: f15bf08 Author: Isabel Jimenez <[email protected]> Authored: Wed Jul 1 14:06:24 2015 -0700 Committer: Benjamin Mahler <[email protected]> Committed: Wed Jul 1 14:06:25 2015 -0700 ---------------------------------------------------------------------- 3rdparty/libprocess/include/process/http.hpp | 39 ++++++++++++++++------- 1 file changed, 27 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/547d911a/3rdparty/libprocess/include/process/http.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/include/process/http.hpp b/3rdparty/libprocess/include/process/http.hpp index 16f0a01..2fbca5b 100644 --- a/3rdparty/libprocess/include/process/http.hpp +++ b/3rdparty/libprocess/include/process/http.hpp @@ -377,34 +377,34 @@ struct TemporaryRedirect : Response }; -struct Unauthorized : Response +struct BadRequest : Response { - Unauthorized(const std::string& realm) + BadRequest() { - status = "401 Unauthorized"; - headers["WWW-authenticate"] = "Basic realm=\"" + realm + "\""; + status = "400 Bad Request"; } - Unauthorized(const std::string& realm, const std::string& body) + explicit BadRequest(const std::string& body) : Response(body) { - status = "401 Unauthorized"; - headers["WWW-authenticate"] = "Basic realm=\"" + realm + "\""; + status = "400 Bad Request"; } }; -struct BadRequest : Response +struct Unauthorized : Response { - BadRequest() + Unauthorized(const std::string& realm) { - status = "400 Bad Request"; + status = "401 Unauthorized"; + headers["WWW-authenticate"] = "Basic realm=\"" + realm + "\""; } - explicit BadRequest(const std::string& body) + Unauthorized(const std::string& realm, const std::string& body) : Response(body) { - status = "400 Bad Request"; + status = "401 Unauthorized"; + headers["WWW-authenticate"] = "Basic realm=\"" + realm + "\""; } }; @@ -437,6 +437,21 @@ struct NotFound : Response }; +struct NotAcceptable : Response +{ + NotAcceptable() + { + status = "406 Not Acceptable"; + } + + explicit NotAcceptable(const std::string& body) + : Response(body) + { + status = "406 Not Acceptable"; + } +}; + + struct InternalServerError : Response { InternalServerError()
