@Test public void extractScheme_NO_X_FORWARDED_PROTO() { when(request.getHeader("X-FORWARDED-PROTO")).thenReturn(null); when(request.getScheme()).thenReturn("https"); assertEquals("https", HttpServletRequestUtils.extractScheme(request)); }
public static String extractScheme(HttpServletRequest request) { Preconditions.checkNotNull(request); String scheme = request.getHeader("X-FORWARDED-PROTO"); if (scheme == null) { scheme = request.getScheme(); } return scheme; }
HttpServletRequestUtils { public static String extractScheme(HttpServletRequest request) { Preconditions.checkNotNull(request); String scheme = request.getHeader("X-FORWARDED-PROTO"); if (scheme == null) { scheme = request.getScheme(); } return scheme; } }
HttpServletRequestUtils { public static String extractScheme(HttpServletRequest request) { Preconditions.checkNotNull(request); String scheme = request.getHeader("X-FORWARDED-PROTO"); if (scheme == null) { scheme = request.getScheme(); } return scheme; } private  HttpServletRequestUtils(); }
HttpServletRequestUtils { public static String extractScheme(HttpServletRequest request) { Preconditions.checkNotNull(request); String scheme = request.getHeader("X-FORWARDED-PROTO"); if (scheme == null) { scheme = request.getScheme(); } return scheme; } private  HttpServletRequestUtils(); static String extractClientIp(HttpServletRequest request); static String extractScheme(HttpServletRequest request); static String extractHost(HttpServletRequest request); static int extractServerPort(HttpServletRequest request); static String constructRequestBaseUrl(HttpServletRequest request); static String constructRequestUrl(HttpServletRequest request); static String constructRequestUrlWithParameters(HttpServletRequest request); static boolean isDefaultPort(String scheme, int port); }
HttpServletRequestUtils { public static String extractScheme(HttpServletRequest request) { Preconditions.checkNotNull(request); String scheme = request.getHeader("X-FORWARDED-PROTO"); if (scheme == null) { scheme = request.getScheme(); } return scheme; } private  HttpServletRequestUtils(); static String extractClientIp(HttpServletRequest request); static String extractScheme(HttpServletRequest request); static String extractHost(HttpServletRequest request); static int extractServerPort(HttpServletRequest request); static String constructRequestBaseUrl(HttpServletRequest request); static String constructRequestUrl(HttpServletRequest request); static String constructRequestUrlWithParameters(HttpServletRequest request); static boolean isDefaultPort(String scheme, int port);  }