You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2015/06/30 16:08:05 UTC
mesos git commit: Remove HTTP specific protocol from master redirect.
Repository: mesos
Updated Branches:
refs/heads/master 37674a667 -> d2f5ca60f
Remove HTTP specific protocol from master redirect.
Review: https://reviews.apache.org/r/36018
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d2f5ca60
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d2f5ca60
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d2f5ca60
Branch: refs/heads/master
Commit: d2f5ca60ffbb06c125d4fa87446dafd14bb471e5
Parents: 37674a6
Author: Joris Van Remoortere <jo...@gmail.com>
Authored: Tue Jun 30 07:04:12 2015 -0700
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Tue Jun 30 07:07:33 2015 -0700
----------------------------------------------------------------------
src/master/http.cpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/d2f5ca60/src/master/http.cpp
----------------------------------------------------------------------
diff --git a/src/master/http.cpp b/src/master/http.cpp
index 3503833..2be613b 100644
--- a/src/master/http.cpp
+++ b/src/master/http.cpp
@@ -436,8 +436,14 @@ Future<Response> Master::Http::redirect(const Request& request) const
return InternalServerError(hostname.error());
}
+ // NOTE: We can use a protocol-relative URL here in order to allow
+ // the browser (or other HTTP client) to prefix with 'http:' or
+ // 'https:' depending on the original request. See
+ // https://tools.ietf.org/html/rfc7231#section-7.1.2 as well as
+ // http://stackoverflow.com/questions/12436669/using-protocol-relative-uris-within-location-headers
+ // which discusses this.
return TemporaryRedirect(
- "http://" + hostname.get() + ":" + stringify(info.port()));
+ "//" + hostname.get() + ":" + stringify(info.port()));
}