Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency org.apache.httpcomponents.core5:httpcore5 to v5.2.2 (release/4.2.x) #3421

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion metrics-httpclient5/pom.xml
Expand Up @@ -38,7 +38,7 @@
<dependency>
<groupId>org.apache.httpcomponents.core5</groupId>
<artifactId>httpcore5</artifactId>
<version>5.2.1</version>
<version>5.2.2</version>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
Expand Down
Expand Up @@ -3,9 +3,9 @@
import org.apache.hc.client5.http.classic.methods.HttpGet;
import org.apache.hc.client5.http.classic.methods.HttpPost;
import org.apache.hc.client5.http.classic.methods.HttpPut;
import org.apache.hc.client5.http.utils.URIUtils;
import org.apache.hc.core5.http.HttpRequest;
import org.apache.hc.core5.http.message.HttpRequestWrapper;
import org.apache.hc.core5.net.URIBuilder;
import org.junit.Test;

import java.net.URI;
Expand Down Expand Up @@ -77,8 +77,8 @@ public void querylessUrlAndMethodWithNameInWrappedRequest() throws URISyntaxExce
}

private static HttpRequest rewriteRequestURI(HttpRequest request) throws URISyntaxException {
URI uri = new URIBuilder(request.getUri()).setFragment(null).build();
HttpRequestWrapper wrapper = new HttpRequestWrapper(request);
URI uri = URIUtils.rewriteURI(wrapper.getUri(), null, true);
wrapper.setUri(uri);

return wrapper;
Expand Down
Expand Up @@ -6,8 +6,8 @@
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpServer;
import org.apache.hc.client5.http.async.methods.SimpleHttpRequest;
import org.apache.hc.client5.http.async.methods.SimpleHttpRequests;
import org.apache.hc.client5.http.async.methods.SimpleHttpResponse;
import org.apache.hc.client5.http.async.methods.SimpleRequestBuilder;
import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient;
import org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager;
import org.apache.hc.core5.concurrent.FutureCallback;
Expand Down Expand Up @@ -74,7 +74,9 @@ public void registersExpectedMetricsGivenNameStrategy() throws Exception {
client = InstrumentedHttpAsyncClients.custom(metricRegistry, metricNameStrategy).disableAutomaticRetries().build();
client.start();

final SimpleHttpRequest request = SimpleHttpRequests.get("http://localhost:" + httpServer.getAddress().getPort() + "/");
final SimpleHttpRequest request = SimpleRequestBuilder
.get("http://localhost:" + httpServer.getAddress().getPort() + "/")
.build();
final String metricName = "some.made.up.metric.name";

httpServer.createContext("/", exchange -> {
Expand Down Expand Up @@ -114,7 +116,9 @@ public void registersExpectedExceptionMetrics() throws Exception {
client.start();

final CountDownLatch countDownLatch = new CountDownLatch(1);
final SimpleHttpRequest request = SimpleHttpRequests.get("http://localhost:" + httpServer.getAddress().getPort() + "/");
final SimpleHttpRequest request = SimpleRequestBuilder
.get("http://localhost:" + httpServer.getAddress().getPort() + "/")
.build();
final String requestMetricName = "request";
final String exceptionMetricName = "exception";

Expand Down Expand Up @@ -160,7 +164,9 @@ public void usesCustomClientConnectionManager() throws Exception {
client = InstrumentedHttpAsyncClients.custom(metricRegistry, metricNameStrategy, clientConnectionManager).disableAutomaticRetries().build();
client.start();

final SimpleHttpRequest request = SimpleHttpRequests.get("http://localhost:" + httpServer.getAddress().getPort() + "/");
final SimpleHttpRequest request = SimpleRequestBuilder
.get("http://localhost:" + httpServer.getAddress().getPort() + "/")
.build();
final String metricName = "some.made.up.metric.name";

httpServer.createContext("/", exchange -> {
Expand Down