예제 #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);
  }
예제 #2
0
  @Override
  protected Optional<String> doRemoteUrl(final HttpRequest request) {
    String uri = request.getUri();
    if (!proxyConfig.canAccessedBy(uri)) {
      return absent();
    }

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