/** * Static factory for instance using <code>http://</code> */ public static ApacheProxyAddressStrategy forHttp() { return new ApacheProxyAddressStrategy(false); }
@Override public String determineServerBase(ServletContext theServletContext, HttpServletRequest theRequest) { String forwardedHost = getForwardedHost(theRequest); if (forwardedHost != null) { return forwardedServerBase(theServletContext, theRequest, forwardedHost); } return super.determineServerBase(theServletContext, theRequest); }
public String forwardedServerBase(ServletContext theServletContext, HttpServletRequest theRequest, String theForwardedHost) { String serverBase = super.determineServerBase(theServletContext, theRequest); String host = theRequest.getHeader("host"); if (host != null) { serverBase = serverBase.replace(host, theForwardedHost); serverBase = serverBase.substring(serverBase.indexOf("://")); return protocol(theRequest) + serverBase; } return serverBase; }
@Override public String determineServerBase(ServletContext theServletContext, HttpServletRequest theRequest) { String forwardedHost = getForwardedHost(theRequest); if (forwardedHost != null) { return forwardedServerBase(theServletContext, theRequest, forwardedHost); } return super.determineServerBase(theServletContext, theRequest); }
/** * Static factory for instance using <code>https://</code> */ public static ApacheProxyAddressStrategy forHttps() { return new ApacheProxyAddressStrategy(true); } }
public String forwardedServerBase(ServletContext theServletContext, HttpServletRequest theRequest, String theForwardedHost) { String serverBase = super.determineServerBase(theServletContext, theRequest); String host = theRequest.getHeader("host"); if (host != null) { serverBase = serverBase.replace(host, theForwardedHost); serverBase = serverBase.substring(serverBase.indexOf("://")); return protocol(theRequest) + serverBase; } return serverBase; }
/** * Static factory for instance using <code>https://</code> */ public static ApacheProxyAddressStrategy forHttps() { return new ApacheProxyAddressStrategy(true); } }
/** * Static factory for instance using <code>http://</code> */ public static ApacheProxyAddressStrategy forHttp() { return new ApacheProxyAddressStrategy(false); }