From 7ed3317d379b913fe61da9e0222ce0a371669503 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jun 2022 14:10:59 -0500 Subject: [PATCH 1/3] Bump google-cloud-datastore from 2.5.1 to 2.6.0 (#8092) Bumps [google-cloud-datastore](https://github.com/googleapis/java-datastore) from 2.5.1 to 2.6.0. - [Release notes](https://github.com/googleapis/java-datastore/releases) - [Changelog](https://github.com/googleapis/java-datastore/blob/main/CHANGELOG.md) - [Commits](https://github.com/googleapis/java-datastore/compare/v2.5.1...v2.6.0) --- updated-dependencies: - dependency-name: com.google.cloud:google-cloud-datastore dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- jetty-gcloud/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetty-gcloud/pom.xml b/jetty-gcloud/pom.xml index 835c3c01090..dc703e414af 100644 --- a/jetty-gcloud/pom.xml +++ b/jetty-gcloud/pom.xml @@ -13,7 +13,7 @@ Jetty :: GCloud - 2.5.1 + 2.6.0 From d12ee70b5acf2c779693bc737d807a6733c2fe30 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 2 Jun 2022 18:24:28 +1000 Subject: [PATCH 2/3] exclude log4j-core to avoid problem with m-enforcer-p see https://issues.apache.org/jira/browse/LOG4J2-3241 (#8094) * exclude log4j-core to avoid problem with m-enforcer-p see https://issues.apache.org/jira/browse/LOG4J2-3241 Signed-off-by: Olivier Lamy --- javadoc/pom.xml | 7 +++++++ jetty-infinispan/infinispan-common/pom.xml | 15 +++++++++++---- jetty-infinispan/infinispan-remote-query/pom.xml | 7 +++++++ jetty-infinispan/infinispan-remote/pom.xml | 7 +++++++ .../test-infinispan-sessions/pom.xml | 7 +++++++ 5 files changed, 39 insertions(+), 4 deletions(-) diff --git a/javadoc/pom.xml b/javadoc/pom.xml index 509837a0a1b..b40b1cf94ce 100644 --- a/javadoc/pom.xml +++ b/javadoc/pom.xml @@ -437,6 +437,13 @@ org.infinispan infinispan-client-hotrod provided + + + + org.apache.logging.log4j + log4j-core + + diff --git a/jetty-infinispan/infinispan-common/pom.xml b/jetty-infinispan/infinispan-common/pom.xml index 2b824ab9262..530301a62dc 100644 --- a/jetty-infinispan/infinispan-common/pom.xml +++ b/jetty-infinispan/infinispan-common/pom.xml @@ -17,10 +17,10 @@ infinispan-core true - - org.wildfly.common - wildfly-common - + + org.wildfly.common + wildfly-common + @@ -46,6 +46,13 @@ org.infinispan infinispan-client-hotrod provided + + + + org.apache.logging.log4j + log4j-core + + org.infinispan diff --git a/jetty-infinispan/infinispan-remote-query/pom.xml b/jetty-infinispan/infinispan-remote-query/pom.xml index fee476bb1aa..f2d2cada24c 100644 --- a/jetty-infinispan/infinispan-remote-query/pom.xml +++ b/jetty-infinispan/infinispan-remote-query/pom.xml @@ -102,6 +102,13 @@ org.infinispan infinispan-client-hotrod + + + + org.apache.logging.log4j + log4j-core + + org.infinispan diff --git a/jetty-infinispan/infinispan-remote/pom.xml b/jetty-infinispan/infinispan-remote/pom.xml index e784437699c..14ff945316e 100644 --- a/jetty-infinispan/infinispan-remote/pom.xml +++ b/jetty-infinispan/infinispan-remote/pom.xml @@ -81,6 +81,13 @@ org.infinispan infinispan-client-hotrod provided + + + + org.apache.logging.log4j + log4j-core + + org.infinispan diff --git a/tests/test-sessions/test-infinispan-sessions/pom.xml b/tests/test-sessions/test-infinispan-sessions/pom.xml index dbc2e38ca49..2733fe6e0bc 100644 --- a/tests/test-sessions/test-infinispan-sessions/pom.xml +++ b/tests/test-sessions/test-infinispan-sessions/pom.xml @@ -129,6 +129,13 @@ org.infinispan infinispan-client-hotrod test + + + + org.apache.logging.log4j + log4j-core + + org.infinispan From 944ce6354fe1db9f199756460893142c70af5f55 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 2 Jun 2022 14:17:26 -0500 Subject: [PATCH 3/3] Fixing #7975 - ForwardedRequestCustomizer should clear old MethodHandles when renaming headers. (#8102) * Adding test case to prove report * Fixing updateHandles() to clear the stored handles list. Signed-off-by: Joakim Erdfelt --- .../server/ForwardedRequestCustomizer.java | 2 + .../ForwardedRequestCustomizerTest.java | 51 +++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java index b7d6f343ea0..6f2538e4070 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java @@ -593,6 +593,8 @@ public class ForwardedRequestCustomizer implements Customizer private void updateHandles() { + _handles.clear(); + MethodHandles.Lookup lookup = MethodHandles.lookup(); try { diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ForwardedRequestCustomizerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ForwardedRequestCustomizerTest.java index d73ee634360..ac7939601bd 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ForwardedRequestCustomizerTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ForwardedRequestCustomizerTest.java @@ -1112,6 +1112,57 @@ public class ForwardedRequestCustomizerTest assertThat("status", response.getStatus(), is(400)); } + public static Stream customHeaderNameRequestCases() + { + return Stream.of( + Arguments.of(new Request("Old name then new name") + .headers( + "GET / HTTP/1.1", + "Host: myhost", + "X-Forwarded-For: 1.1.1.1", + "X-Custom-For: 2.2.2.2" + ) + .configureCustomizer((forwardedRequestCustomizer) -> + forwardedRequestCustomizer.setForwardedForHeader("X-Custom-For")), + new Expectations() + .scheme("http").serverName("myhost").serverPort(80) + .secure(false) + .requestURL("http://myhost/") + .remoteAddr("2.2.2.2").remotePort(0) + ), + Arguments.of(new Request("New name then old name") + .headers( + "GET / HTTP/1.1", + "Host: myhost", + "X-Custom-For: 2.2.2.2", + "X-Forwarded-For: 1.1.1.1" + ) + .configureCustomizer((forwardedRequestCustomizer) -> + forwardedRequestCustomizer.setForwardedForHeader("X-Custom-For")), + new Expectations() + .scheme("http").serverName("myhost").serverPort(80) + .secure(false) + .requestURL("http://myhost/") + .remoteAddr("2.2.2.2").remotePort(0) + ) + ); + } + + @ParameterizedTest + @MethodSource("customHeaderNameRequestCases") + public void testCustomHeaderName(Request request, Expectations expectations) throws Exception + { + request.configure(customizer); + + String rawRequest = request.getRawRequest((header) -> header); + // System.out.println(rawRequest); + + HttpTester.Response response = HttpTester.parseResponse(connector.getResponse(rawRequest)); + assertThat("status", response.getStatus(), is(200)); + + expectations.accept(actual); + } + private static class Request { String description;