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/2bb3e231 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/2bb3e231 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/2bb3e231 Branch: refs/heads/jyx/1.0.x Commit: 2bb3e2314f60fe2b8e80df7b6bab000e736eea1d Parents: f74bad3 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 22:49:39 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/2bb3e231/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/2bb3e231/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: