private boolean isForwardedProtoHeaderValueSecure(String protocolHeaderValue) { if (!protocolHeaderValue.contains(",")) { return protocolHeaderHttpsValue.equalsIgnoreCase(protocolHeaderValue); } String[] forwardedProtocols = commaDelimitedListToStringArray(protocolHeaderValue); if (forwardedProtocols.length == 0) { return false; } for (int i = 0; i < forwardedProtocols.length; i++) { if (!protocolHeaderHttpsValue.equalsIgnoreCase(forwardedProtocols[i])) { return false; } } return true; }
/** * Convert a given comma delimited list of regular expressions into an array of compiled {@link Pattern} * * @return array of patterns (not <code>null</code>) */ protected static Pattern[] commaDelimitedListToPatternArray(String commaDelimitedPatterns) { String[] patterns = commaDelimitedListToStringArray(commaDelimitedPatterns); List<Pattern> patternsList = new ArrayList<Pattern>(); for (String pattern : patterns) { try { patternsList.add(Pattern.compile(pattern)); } catch (PatternSyntaxException e) { throw new IllegalArgumentException("Illegal pattern syntax '" + pattern + "'", e); } } return patternsList.toArray(new Pattern[0]); }
/** * Convert a given comma delimited list of regular expressions into an array of compiled {@link Pattern} * * @return array of patterns (not <code>null</code>) */ protected static Pattern[] commaDelimitedListToPatternArray(String commaDelimitedPatterns) { String[] patterns = commaDelimitedListToStringArray(commaDelimitedPatterns); List<Pattern> patternsList = new ArrayList<Pattern>(); for (String pattern : patterns) { try { patternsList.add(Pattern.compile(pattern)); } catch (PatternSyntaxException e) { throw MESSAGES.remoteIpValvePatternError(pattern, e); } } return patternsList.toArray(new Pattern[0]); }
String[] remoteIpHeaderValue = commaDelimitedListToStringArray(concatRemoteIpHeaderValue.toString()); int idx;
String[] remoteIpHeaderValue = commaDelimitedListToStringArray(concatRemoteIpHeaderValue.toString()); int idx;
String[] remoteIpHeaderValue = commaDelimitedListToStringArray(concatRemoteIpHeaderValue.toString()); int idx;
String[] remoteIpHeaderValue = commaDelimitedListToStringArray(concatRemoteIpHeaderValue.toString()); int idx; if (!isInternal) {
String[] remoteIpHeaderValue = commaDelimitedListToStringArray(concatRemoteIpHeaderValue.toString()); int idx;
String[] remoteIpHeaderValue = commaDelimitedListToStringArray(concatRemoteIpHeaderValue.toString()); int idx;
String[] remoteIpHeaderValue = commaDelimitedListToStringArray(concatRemoteIpHeaderValue.toString()); int idx; if (!isInternal) {
String[] remoteIpHeaderValue = commaDelimitedListToStringArray(concatRemoteIpHeaderValue.toString()); int idx;
String[] remoteIPHeaderValue = commaDelimitedListToStringArray(request.getHeader(remoteIPHeader)); int idx;
String[] remoteIPHeaderValue = commaDelimitedListToStringArray(request.getHeader(remoteIPHeader)); int idx;