Skip to content

Commit

Permalink
Properly enforce HTTP 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nck-mlcnv committed Feb 8, 2024
1 parent fdbffa4 commit 9c293d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public Supplier<InputStream> getStreamSupplier() {
.POST(HttpRequest.BodyPublishers.ofInputStream(new CustomStreamSupplier().getStreamSupplier()));
}
}

return request.build();
}
}
Expand Down Expand Up @@ -423,6 +424,7 @@ private HttpExecutionResult executeHttpRequest(Duration timeout) {

private HttpClient buildHttpClient() {
return HttpClient.newBuilder()
.version(HttpClient.Version.HTTP_1_1)
.executor(Executors.newFixedThreadPool(1))
.followRedirects(HttpClient.Redirect.ALWAYS)
.connectTimeout(config().timeout())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ public void testRequestFactory(SPARQLProtocolWorker worker) {
.withBasicAuth("testUser", "password")
.withRequestBody(equalTo(QUERY))
.willReturn(aResponse().withStatus(200).withBody("Non-Empty-Body")));
return;
}
case POST_UPDATE -> {
wm.stubFor(post(urlPathEqualTo("/ds/query"))
Expand All @@ -129,7 +128,6 @@ public void testRequestFactory(SPARQLProtocolWorker worker) {
.withBasicAuth("testUser", "password")
.withRequestBody(equalTo(QUERY))
.willReturn(aResponse().withStatus(200).withBody("Non-Empty-Body")));
return; // TODO: wiremock behaves really weirdly when the request body is streamed
}

case POST_URL_ENC_QUERY -> wm.stubFor(post(urlPathEqualTo("/ds/query"))
Expand Down

0 comments on commit 9c293d6

Please sign in to comment.