Repository: mesos Updated Branches: refs/heads/master 3f488e8d3 -> da4687c33
Added `URL::isAbsolute` to check if the URL is absolute. Review: https://reviews.apache.org/r/50593/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/e5630fd7 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/e5630fd7 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/e5630fd7 Branch: refs/heads/master Commit: e5630fd794b6acabb7b43385fcfce15a45a782e3 Parents: 3f488e8 Author: haosdent huang <haosd...@gmail.com> Authored: Fri Jul 29 15:59:28 2016 -0700 Committer: Jiang Yan Xu <xuj...@apple.com> Committed: Fri Jul 29 16:08:13 2016 -0700 ---------------------------------------------------------------------- 3rdparty/libprocess/include/process/http.hpp | 6 ++++++ 3rdparty/libprocess/src/http.cpp | 6 ++++++ 2 files changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/e5630fd7/3rdparty/libprocess/include/process/http.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/include/process/http.hpp b/3rdparty/libprocess/include/process/http.hpp index c17c047..404196b 100644 --- a/3rdparty/libprocess/include/process/http.hpp +++ b/3rdparty/libprocess/include/process/http.hpp @@ -153,6 +153,12 @@ struct URL static Try<URL> parse(const std::string& urlString); + /** + * Returns whether the URL is absolute. + * See https://tools.ietf.org/html/rfc3986#section-4.3 for details. + */ + bool isAbsolute() const; + Option<std::string> scheme; // TODO(benh): Consider using unrestricted union for 'domain' and 'ip'. http://git-wip-us.apache.org/repos/asf/mesos/blob/e5630fd7/3rdparty/libprocess/src/http.cpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/src/http.cpp b/3rdparty/libprocess/src/http.cpp index 1bf1f3b..298bd46 100644 --- a/3rdparty/libprocess/src/http.cpp +++ b/3rdparty/libprocess/src/http.cpp @@ -243,6 +243,12 @@ Try<URL> URL::parse(const string& urlString) } +bool URL::isAbsolute() const +{ + return scheme.isSome(); +} + + bool Request::acceptsEncoding(const string& encoding) const { // From RFC 2616: