@Test public void getSourceBaseURL() throws MalformedURLException { assertSourceBaseURL("http: assertSourceBaseURL("http: assertSourceBaseURL("https: assertSourceBaseURL("https: assertSourceBaseURL("http: assertSourceBaseURL("http: assertSourceBaseURL("https: assertSourceBaseURL("https: assertSourceBaseURL("https: forwarded("proto=https, proto=http; host=sourcehost, host=sourcehost2")); assertSourceBaseURL("https: assertSourceBaseURL("http: assertSourceBaseURL("http: assertSourceBaseURL("http: assertSourceBaseURL("http: assertSourceBaseURL("http: assertSourceBaseURL("http: assertSourceBaseURL("https: assertSourceBaseURL("https: assertSourceBaseURL("https: assertSourceBaseURL("https: xhost("sourcehost2"), xproto("http")); assertSourceBaseURL("https: xhost("sourcehost2"), xproto("https")); }
public static URL getSourceBaseURL(HttpServletRequest servletRequest) { StringBuilder builder = new StringBuilder(); appendScheme(servletRequest, builder); builder.append(": appendHostPort(servletRequest, builder); try { return new URL(builder.toString()); } catch (MalformedURLException e) { return getFinalBaseURL(servletRequest); } }
HttpServletUtils { public static URL getSourceBaseURL(HttpServletRequest servletRequest) { StringBuilder builder = new StringBuilder(); appendScheme(servletRequest, builder); builder.append(": appendHostPort(servletRequest, builder); try { return new URL(builder.toString()); } catch (MalformedURLException e) { return getFinalBaseURL(servletRequest); } } }
HttpServletUtils { public static URL getSourceBaseURL(HttpServletRequest servletRequest) { StringBuilder builder = new StringBuilder(); appendScheme(servletRequest, builder); builder.append(": appendHostPort(servletRequest, builder); try { return new URL(builder.toString()); } catch (MalformedURLException e) { return getFinalBaseURL(servletRequest); } } private  HttpServletUtils(); }
HttpServletUtils { public static URL getSourceBaseURL(HttpServletRequest servletRequest) { StringBuilder builder = new StringBuilder(); appendScheme(servletRequest, builder); builder.append(": appendHostPort(servletRequest, builder); try { return new URL(builder.toString()); } catch (MalformedURLException e) { return getFinalBaseURL(servletRequest); } } private  HttpServletUtils(); static URL getSourceURL(HttpServletRequest servletRequest); static URL getSourceBaseURL(HttpServletRequest servletRequest); static boolean isCacheReadAllowed(HttpServletRequest request); }
HttpServletUtils { public static URL getSourceBaseURL(HttpServletRequest servletRequest) { StringBuilder builder = new StringBuilder(); appendScheme(servletRequest, builder); builder.append(": appendHostPort(servletRequest, builder); try { return new URL(builder.toString()); } catch (MalformedURLException e) { return getFinalBaseURL(servletRequest); } } private  HttpServletUtils(); static URL getSourceURL(HttpServletRequest servletRequest); static URL getSourceBaseURL(HttpServletRequest servletRequest); static boolean isCacheReadAllowed(HttpServletRequest request); static final String HEADER_FORWARDED; static final String HEADER_X_FORWARDED_HOST; static final String HEADER_X_FORWARDED_PROTO; }