Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ protected Future<TokenUsage> collectTokenUsage(Buffer responseBody) {

protected Future<HttpClientRequest> createProxyRequest(Function<Deployment, String> endpointSelector) {
HttpServerRequest request = context.getRequest();
String uri = endpointSelector.apply(context.getDeployment()) + (request.query() == null ? "" : request.query());
String uri = endpointSelector.apply(context.getDeployment())
+ (request.query() == null ? "" : "?" + request.query());
RequestOptions options = new RequestOptions()
.setAbsoluteURI(uri)
.setMethod(request.method())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ public void testModelResponse(Vertx vertx, VertxTestContext textContext) throws
when(request.getHeader(HttpHeaders.CONTENT_TYPE)).thenReturn(HEADER_CONTENT_TYPE_APPLICATION_JSON);
when(request.body()).thenReturn(Future.succeededFuture(requestBody));
when(request.headers()).thenReturn(new HeadersMultiMap());
when(request.query()).thenReturn("arg=value");
when(upstreamRoute.next()).thenReturn(upstream);
when(upstreamRoute.get()).thenReturn(upstream);
when(context.getUpstreamRoute()).thenReturn(upstreamRoute);
Expand Down Expand Up @@ -286,6 +287,8 @@ public void testModelResponse(Vertx vertx, VertxTestContext textContext) throws

await(textContext);

verify(proxy.getClient()).request(argThat(req ->
"/responses?arg=value".equals(req.getURI().toString())));
assertEquals(responseBody, context.getResponseBody());
assertEquals(tokenUsage, context.getTokenUsage());
}
Expand Down
Loading