Esempio n. 1
0
  private ImmutableMap<String, String> doExtract(HttpRequest request) {
    QueryStringDecoder decoder = new QueryStringDecoder(request.getUri());
    Map<String, String> queries = newHashMap();
    for (Map.Entry<String, List<String>> entry : decoder.parameters().entrySet()) {
      queries.put(entry.getKey(), entry.getValue().get(0));
    }

    return copyOf(queries);
  }
  @Override
  protected Optional<String> doRemoteUrl(final HttpRequest request) {
    String uri = request.getUri();
    if (!proxyConfig.canAccessedBy(uri)) {
      return absent();
    }

    return of(proxyConfig.remoteUrl(uri));
  }