+ return getRequestUrlBase(req, false);
+ }
+
+ /**
+ * The base URL for this query (without any path component (not even an ending
+ * '/'), taking into account reverse proxies.
+ *
+ * @param forceReverseProxyHttps if a reverse proxy is detected and this is set
+ * to true, the https scheme will be used. This is
+ * to work around issued when the an https reverse
+ * proxy is talking to an http application.
+ */
+ public static StringBuilder getRequestUrlBase(HttpServletRequest req, boolean forceReverseProxyHttps) {