Skip to content

Commit

Permalink
fix: remove host headers in GrpcConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
jgiovaresco committed Jan 17, 2024
1 parent 0785edf commit 09c4c9c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class HttpConnection<T extends HttpResponse> extends AbstractHttpConnecti
HOP_HEADERS = Collections.unmodifiableSet(hopHeaders);
}

private HttpClientRequest httpClientRequest;
protected HttpClientRequest httpClientRequest;
private final ProxyRequest request;
private T response;
private Handler<Throwable> timeoutHandler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import io.vertx.core.Future;
import io.vertx.core.http.HttpClient;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.http.HttpHeaders;
import io.vertx.core.http.HttpMethod;
import io.vertx.core.http.RequestOptions;

Expand Down Expand Up @@ -60,4 +61,12 @@ protected Future<HttpClientRequest> prepareUpstreamRequest(HttpClient httpClient
return httpClientRequest.setChunked(true);
});
}

@Override
protected void writeUpstreamHeaders() {
super.writeUpstreamHeaders();

// Remove host header because gRPC is HTTP/2
httpClientRequest.headers().remove(HttpHeaders.HOST);
}
}

0 comments on commit 09c4c9c

Please sign in to comment.