Skip to content

Commit

Permalink
Fix use of HttpClient in HttpTowerConnector
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <[email protected]>
  • Loading branch information
pditommaso committed Oct 1, 2023
1 parent 80ee4ed commit dc633b1
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package io.seqera.wave.tower.client.connector

import java.net.http.HttpClient

import java.net.http.HttpRequest
import java.net.http.HttpResponse
import java.util.concurrent.CompletableFuture
Expand Down Expand Up @@ -46,14 +46,9 @@ class HttpTowerConnector extends TowerConnector {
@Inject
private HttpClientConfig config

private HttpClient client

{
this.client = HttpClientFactory.neverRedirectsHttpClient()
}

@Override
CompletableFuture<ProxyHttpResponse> sendAsync(String endpoint, ProxyHttpRequest request) {
final client = HttpClientFactory.neverRedirectsHttpClient()
client
.sendAsync(buildHttpRequest(request), HttpResponse.BodyHandlers.ofString())
.thenApply( (resp)-> {
Expand Down

0 comments on commit dc633b1

Please sign in to comment.