return Iterators.contains(
Iterators.forEnumeration(request.getHeaders(PRAGMA)), X_SUPPRESS_STATUS_CODE);
}
private HttpMethodBase getMethod(final HttpServletRequest request) throws IOException {
final HttpMethod method = HttpMethod.valueOf(request.getMethod());
String uri = request.getRequestURI();
if (prefix != null && !uri.startsWith(prefix)) {
// Probably impossible.
throw new RuntimeException(
String.format(REQUEST_URI_DOES_NOT_START_WITH_PREFIX, uri, prefix));
}
String url = prefix == null ? destination + uri : destination + uri.substring(prefix.length());
switch (method) {
case POST:
case PUT:
return new GatewayEntityMethod(
method.name(), url, request.getInputStream());
default:
return new GatewayMethod(method.name(), url);
}
}