From 23a1dc59a39d6e8c8a952961bb9ded3b68aad7d2 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Mon, 21 Feb 2022 13:12:26 -0600 Subject: [PATCH 01/29] Issue #5965 - fixing invalid dot output from start.jar (#7606) * Adding testcase that can use `dot` if it exists on the machine. --- .../jetty/start/ModuleGraphWriter.java | 18 ++++--- .../jetty/start/ModuleGraphWriterTest.java | 52 +++++++++++++++++-- 2 files changed, 61 insertions(+), 9 deletions(-) diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/ModuleGraphWriter.java b/jetty-start/src/main/java/org/eclipse/jetty/start/ModuleGraphWriter.java index 6c9050959a6..f5a33f454d4 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/ModuleGraphWriter.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/ModuleGraphWriter.java @@ -29,6 +29,8 @@ public class ModuleGraphWriter { private String colorModuleBg; private String colorEnabledBg; + private String colorEdgeBefore; + private String colorEdgeAfter; private String colorTransitiveBg; private String colorCellBg; private String colorHeaderBg; @@ -38,6 +40,8 @@ public class ModuleGraphWriter { colorModuleBg = "#B8FFB8"; colorEnabledBg = "#66FFCC"; + colorEdgeAfter = "#00CC33"; + colorEdgeAfter = "#33CC00"; colorTransitiveBg = "#66CC66"; colorCellBg = "#FFFFFF80"; colorHeaderBg = "#00000020"; @@ -49,6 +53,8 @@ public class ModuleGraphWriter String prefix = "jetty.graph."; colorModuleBg = getProperty(props, prefix + "color.module.bg", colorModuleBg); colorEnabledBg = getProperty(props, prefix + "color.enabled.bg", colorEnabledBg); + colorEdgeBefore = getProperty(props, prefix + "color.edge.before", colorEdgeBefore); + colorEdgeAfter = getProperty(props, prefix + "color.edge.after", colorEdgeAfter); colorTransitiveBg = getProperty(props, prefix + "color.transitive.bg", colorTransitiveBg); colorCellBg = getProperty(props, prefix + "color.cell.bg", colorCellBg); colorHeaderBg = getProperty(props, prefix + "color.header.bg", colorHeaderBg); @@ -73,7 +79,7 @@ public class ModuleGraphWriter public void write(Modules modules, Path outputFile) throws IOException { try (BufferedWriter writer = Files.newBufferedWriter(outputFile, StandardCharsets.UTF_8, StandardOpenOption.CREATE_NEW, StandardOpenOption.WRITE); - PrintWriter out = new PrintWriter(writer);) + PrintWriter out = new PrintWriter(writer)) { writeHeaderMessage(out, outputFile); @@ -245,13 +251,13 @@ public class ModuleGraphWriter depends = Module.normalizeModuleName(depends); out.printf(" \"%s\" -> \"%s\";%n", module.getName(), depends); } + for (String optional : module.getAfter()) + { + out.printf(" \"%s\" -> \"%s\" [ color=\"%s\" ];%n", module.getName(), optional, colorEdgeAfter); + } for (String before : module.getBefore()) { - out.printf(" \"%s\" << \"%s\";%n", module.getName(), before); - } - for (String after : module.getAfter()) - { - out.printf(" \"%s\" >> \"%s\";%n", module.getName(), after); + out.printf(" \"%s\" -> \"%s\" [ color=\"%s\" ];%n", before, module.getName(), colorEdgeBefore); } } } diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/ModuleGraphWriterTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/ModuleGraphWriterTest.java index 8482e98ddc3..431c9c3b1d5 100644 --- a/jetty-start/src/test/java/org/eclipse/jetty/start/ModuleGraphWriterTest.java +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/ModuleGraphWriterTest.java @@ -13,8 +13,12 @@ package org.eclipse.jetty.start; +import java.io.BufferedReader; import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; import java.nio.file.Path; +import java.time.Duration; import org.eclipse.jetty.start.config.CommandLineConfigSource; import org.eclipse.jetty.start.config.ConfigSources; @@ -28,6 +32,8 @@ import org.junit.jupiter.api.extension.ExtendWith; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; +import static org.junit.jupiter.api.Assertions.assertTimeout; +import static org.junit.jupiter.api.Assertions.assertTrue; @ExtendWith(WorkDirExtension.class) public class ModuleGraphWriterTest @@ -58,11 +64,51 @@ public class ModuleGraphWriterTest Modules modules = new Modules(basehome, args); modules.registerAll(); - Path outputFile = basehome.getBasePath("graph.dot"); + Path dotFile = basehome.getBasePath("graph.dot"); ModuleGraphWriter writer = new ModuleGraphWriter(); - writer.write(modules, outputFile); + writer.write(modules, dotFile); - assertThat("Output File Exists", FS.exists(outputFile), is(true)); + assertThat("Output File Exists", FS.exists(dotFile), is(true)); + + assertTimeout(Duration.ofSeconds(3), () -> + { + if (execDotCmd("dot", "-V")) + { + Path outputPng = testdir.getPath().resolve("output.png"); + assertTrue(execDotCmd("dot", "-Tpng", "-o" + outputPng, dotFile.toString())); + + assertThat("PNG File does not exist", FS.exists(outputPng)); + } + }); + } + + private boolean execDotCmd(String... args) + { + try + { + Process p = Runtime.getRuntime().exec(args); + + try (BufferedReader bri = new BufferedReader(new InputStreamReader(p.getInputStream(), StandardCharsets.UTF_8)); + BufferedReader bre = new BufferedReader(new InputStreamReader(p.getErrorStream(), StandardCharsets.UTF_8))) + { + String line; + while ((line = bri.readLine()) != null) + { + System.out.printf("[STDIN] %s%n", line); + } + while ((line = bre.readLine()) != null) + { + System.out.printf("[STDERR] %s%n", line); + } + } + p.waitFor(); + return true; + } + catch (IOException | InterruptedException e) + { + e.printStackTrace(); + return false; + } } } From 07c1ec21672a052cfdeebb0190ccb9c4291e37f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Feb 2022 09:24:53 +0000 Subject: [PATCH 02/29] Bump tycho-p2-repository-plugin from 2.6.0 to 2.7.0 Bumps tycho-p2-repository-plugin from 2.6.0 to 2.7.0. --- updated-dependencies: - dependency-name: org.eclipse.tycho:tycho-p2-repository-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- jetty-p2/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetty-p2/pom.xml b/jetty-p2/pom.xml index c5d9bb5a460..28090d0fb5c 100644 --- a/jetty-p2/pom.xml +++ b/jetty-p2/pom.xml @@ -12,7 +12,7 @@ Generates a (maven based) P2 Updatesite pom - 2.6.0 + 2.7.0 From 8065d9f9b4832b3f1c38aa05d8f1b421b0cf90f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Feb 2022 09:25:39 +0000 Subject: [PATCH 03/29] Bump log4j-api from 2.17.1 to 2.17.2 Bumps log4j-api from 2.17.1 to 2.17.2. --- updated-dependencies: - dependency-name: org.apache.logging.log4j:log4j-api dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 552121e5590..5f911b767b1 100644 --- a/pom.xml +++ b/pom.xml @@ -101,7 +101,7 @@ 9.0.52 5.8.2 2.0.1 - 2.17.1 + 2.17.2 1.3.0-alpha14 3.0.3 10.3.6 From 7306628c596523f4c7ec7631b8c4f91242a44163 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Mar 2022 09:20:19 +0000 Subject: [PATCH 04/29] Bump jetty-quiche-native from 0.11.0.2 to 0.12.0 Bumps [jetty-quiche-native](https://github.com/jetty-project/jetty-quiche-native) from 0.11.0.2 to 0.12.0. - [Release notes](https://github.com/jetty-project/jetty-quiche-native/releases) - [Commits](https://github.com/jetty-project/jetty-quiche-native/compare/jetty-quiche-native-0.11.0.2...jetty-quiche-native-0.12.0) --- updated-dependencies: - dependency-name: org.mortbay.jetty.quiche:jetty-quiche-native dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 552121e5590..6d68fd99e77 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 3.1.0.Final 1.1 1.0.7 - 0.11.0.2 + 0.12.0 4.0.6 1.2 5.9 From 0eec616299e9da5a063846453422fbfe61bd0abd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Mar 2022 09:21:19 +0000 Subject: [PATCH 05/29] Bump guava from 31.0.1-jre to 31.1-jre Bumps [guava](https://github.com/google/guava) from 31.0.1-jre to 31.1-jre. - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) --- updated-dependencies: - dependency-name: com.google.guava:guava dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 552121e5590..6f3e3d4845d 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ 2.11.0 1.44.1 2.9.0 - 31.0.1-jre + 31.1-jre 5.1.0 2.2 2.14.5 From f7bbff2cfda1efcfe239d79ff4fafa56fbe5de95 Mon Sep 17 00:00:00 2001 From: Ludovic Orban Date: Mon, 28 Feb 2022 13:25:57 +0100 Subject: [PATCH 06/29] Upgrade to quiche version 0.12.0 Signed-off-by: Ludovic Orban --- .../eclipse/jetty/quic/quiche/foreign/incubator/quiche_h.java | 2 +- .../main/java/org/eclipse/jetty/quic/quiche/jna/LibQuiche.java | 2 +- pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jetty-quic/quic-quiche/quic-quiche-foreign-incubator/src/main/java/org/eclipse/jetty/quic/quiche/foreign/incubator/quiche_h.java b/jetty-quic/quic-quiche/quic-quiche-foreign-incubator/src/main/java/org/eclipse/jetty/quic/quiche/foreign/incubator/quiche_h.java index 8a4fa08d62f..af8584f1881 100644 --- a/jetty-quic/quic-quiche/quic-quiche-foreign-incubator/src/main/java/org/eclipse/jetty/quic/quiche/foreign/incubator/quiche_h.java +++ b/jetty-quic/quic-quiche/quic-quiche-foreign-incubator/src/main/java/org/eclipse/jetty/quic/quiche/foreign/incubator/quiche_h.java @@ -33,7 +33,7 @@ public class quiche_h { // This interface is a translation of the quiche.h header of a specific version. // It needs to be reviewed each time the native lib version changes. - private static final String EXPECTED_QUICHE_VERSION = "0.11.0"; + private static final String EXPECTED_QUICHE_VERSION = "0.12.0"; public static final byte C_FALSE = 0; public static final byte C_TRUE = 1; diff --git a/jetty-quic/quic-quiche/quic-quiche-jna/src/main/java/org/eclipse/jetty/quic/quiche/jna/LibQuiche.java b/jetty-quic/quic-quiche/quic-quiche-jna/src/main/java/org/eclipse/jetty/quic/quiche/jna/LibQuiche.java index dbeed8c899b..2ccb3295a96 100644 --- a/jetty-quic/quic-quiche/quic-quiche-jna/src/main/java/org/eclipse/jetty/quic/quiche/jna/LibQuiche.java +++ b/jetty-quic/quic-quiche/quic-quiche-jna/src/main/java/org/eclipse/jetty/quic/quiche/jna/LibQuiche.java @@ -31,7 +31,7 @@ public interface LibQuiche extends Library { // This interface is a translation of the quiche.h header of a specific version. // It needs to be reviewed each time the native lib version changes. - String EXPECTED_QUICHE_VERSION = "0.11.0"; + String EXPECTED_QUICHE_VERSION = "0.12.0"; // The charset used to convert java.lang.String to char * and vice versa. Charset CHARSET = StandardCharsets.UTF_8; diff --git a/pom.xml b/pom.xml index e592d5aa4b6..64370753cf4 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 3.1.0.Final 1.1 1.0.7 - 0.11.0.2 + 0.12.0 4.0.6 1.2 5.9 From 3f3c6d1cce484194c36c49ecb920e09246b2d855 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 09:30:37 +0000 Subject: [PATCH 07/29] Bump google-cloud-datastore from 2.2.4 to 2.2.5 Bumps [google-cloud-datastore](https://github.com/googleapis/java-datastore) from 2.2.4 to 2.2.5. - [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.2.4...v2.2.5) --- updated-dependencies: - dependency-name: com.google.cloud:google-cloud-datastore dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- 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 dc7479d15a7..ade22e38a0b 100644 --- a/jetty-gcloud/pom.xml +++ b/jetty-gcloud/pom.xml @@ -13,7 +13,7 @@ Jetty :: GCloud - 2.2.4 + 2.2.5 From 3d4b68d0bcf995aa9e7027402e3685b813f70383 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Sat, 5 Mar 2022 19:47:32 +1000 Subject: [PATCH 08/29] remove some site configuration, non used checkstyle profile and turn skip xml into one line property (#7687) * remove some site configuration, non used checkstyle profile and turn skip xml into one line property Signed-off-by: Olivier Lamy --- apache-jsp/pom.xml | 8 +---- apache-jstl/pom.xml | 8 +---- jetty-ant/pom.xml | 8 +---- jetty-http-spi/pom.xml | 8 +---- jetty-jspc-maven-plugin/pom.xml | 64 +-------------------------------- jetty-maven-plugin/pom.xml | 54 +--------------------------- jetty-osgi/pom.xml | 8 +---- pom.xml | 47 ------------------------ tests/test-webapps/pom.xml | 23 +++--------- 9 files changed, 11 insertions(+), 217 deletions(-) diff --git a/apache-jsp/pom.xml b/apache-jsp/pom.xml index 5f48eb85315..e3ca6a2c6e2 100644 --- a/apache-jsp/pom.xml +++ b/apache-jsp/pom.xml @@ -11,6 +11,7 @@ ${project.groupId}.apache-jsp + true @@ -52,13 +53,6 @@ - - org.jacoco - jacoco-maven-plugin - - true - - diff --git a/apache-jstl/pom.xml b/apache-jstl/pom.xml index 59672a49ebf..925898bb697 100644 --- a/apache-jstl/pom.xml +++ b/apache-jstl/pom.xml @@ -11,6 +11,7 @@ jar ${project.groupId}.apache.jstl + true @@ -22,13 +23,6 @@ false - - org.jacoco - jacoco-maven-plugin - - true - - diff --git a/jetty-ant/pom.xml b/jetty-ant/pom.xml index ac189780ddf..bd0597fbd5b 100644 --- a/jetty-ant/pom.xml +++ b/jetty-ant/pom.xml @@ -11,6 +11,7 @@ ${project.groupId}.ant + true @@ -48,13 +49,6 @@ - - org.jacoco - jacoco-maven-plugin - - true - - diff --git a/jetty-http-spi/pom.xml b/jetty-http-spi/pom.xml index 7c28f051663..a4063352548 100644 --- a/jetty-http-spi/pom.xml +++ b/jetty-http-spi/pom.xml @@ -10,6 +10,7 @@ ${project.groupId}.http.spi org.eclipse.jetty.http.spi.* + true @@ -80,13 +81,6 @@ - - org.jacoco - jacoco-maven-plugin - - true - - diff --git a/jetty-jspc-maven-plugin/pom.xml b/jetty-jspc-maven-plugin/pom.xml index a36748cff26..b436db8b597 100644 --- a/jetty-jspc-maven-plugin/pom.xml +++ b/jetty-jspc-maven-plugin/pom.xml @@ -11,16 +11,10 @@ Jetty :: Jetty JSPC Maven Plugin ${project.groupId}.jspc.plugin + true - - org.apache.maven.plugins - maven-surefire-plugin - - true - - org.apache.maven.plugins maven-plugin-plugin @@ -35,13 +29,6 @@ - - org.jacoco - jacoco-maven-plugin - - true - - org.apache.maven.plugins maven-invoker-plugin @@ -133,53 +120,4 @@ ant - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - - false - - - - - team - mailing-lists - ci-management - issue-management - licenses - scm - - - - - - org.apache.maven.plugins - maven-plugin-plugin - - - - - - eclipse-release - - - - org.apache.maven.plugins - maven-site-plugin - - - site-jar - - jar - - package - - - - - - - diff --git a/jetty-maven-plugin/pom.xml b/jetty-maven-plugin/pom.xml index 0c6a0386a73..ea7da834a71 100644 --- a/jetty-maven-plugin/pom.xml +++ b/jetty-maven-plugin/pom.xml @@ -13,6 +13,7 @@ ${project.groupId}.maven.plugin FREEBEER + true @@ -110,13 +111,6 @@ - - org.jacoco - jacoco-maven-plugin - - true - - @@ -373,50 +367,4 @@ test - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - - - - team - mailing-lists - ci-management - issue-management - licenses - scm - - - - - - org.apache.maven.plugins - maven-plugin-plugin - - - - - - eclipse-release - - - - org.apache.maven.plugins - maven-site-plugin - - - site-jar - - jar - - package - - - - - - - diff --git a/jetty-osgi/pom.xml b/jetty-osgi/pom.xml index cb153805924..f955fde28fe 100644 --- a/jetty-osgi/pom.xml +++ b/jetty-osgi/pom.xml @@ -16,6 +16,7 @@ 3.10.200 3.6.100 1.0.0-v20070606 + true @@ -72,13 +73,6 @@ - - org.jacoco - jacoco-maven-plugin - - true - - diff --git a/pom.xml b/pom.xml index 64370753cf4..376b17e58b7 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,6 @@ 3.1.1 3.6.4 3.6.4 - 3.2.1 2.5.3 1.7.0 3.2.0 @@ -700,11 +699,6 @@ maven-plugin-plugin ${maven-plugin.plugin.version} - - org.apache.maven.plugins - maven-project-info-reports-plugin - ${maven.project-info-reports.plugin.version} - org.apache.maven.plugins maven-release-plugin @@ -2064,47 +2058,6 @@ - - checkstyle - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - ${maven.project-info-reports.plugin.version} - - - org.apache.maven.plugins - maven-checkstyle-plugin - - - - checkstyle - - - - - - - - - - org.apache.maven.plugins - maven-site-plugin - ${maven.site.plugin.version} - - - build-site - - site - - package - - - - - - config diff --git a/tests/test-webapps/pom.xml b/tests/test-webapps/pom.xml index 6f1cfabf7c1..d7a97ab965f 100644 --- a/tests/test-webapps/pom.xml +++ b/tests/test-webapps/pom.xml @@ -10,25 +10,10 @@ test-webapps-parent Jetty Tests :: WebApps :: Parent pom - - - - org.apache.maven.plugins - maven-deploy-plugin - - - true - - - - org.jacoco - jacoco-maven-plugin - - true - - - - + + true + true + test-webapp-rfc2616 test-http2-webapp From eaf94527066ea603a968b8e1cda87c4f3cc39a62 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Mar 2022 09:24:23 +0000 Subject: [PATCH 09/29] Bump jackson-annotations from 2.13.1 to 2.13.2 Bumps [jackson-annotations](https://github.com/FasterXML/jackson) from 2.13.1 to 2.13.2. - [Release notes](https://github.com/FasterXML/jackson/releases) - [Commits](https://github.com/FasterXML/jackson/commits) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-annotations dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 376b17e58b7..6b1304d772a 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,7 @@ 4.2.4 4.3.5.Final 11.0.15.Final - 2.13.1 + 2.13.2 2.13.1 2.13.1 1.2.2 From 3b180b77e52ef54b6efe254b46c820e7529eb083 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Mar 2022 09:25:14 +0000 Subject: [PATCH 10/29] Bump awaitility from 4.1.1 to 4.2.0 Bumps [awaitility](https://github.com/awaitility/awaitility) from 4.1.1 to 4.2.0. - [Release notes](https://github.com/awaitility/awaitility/releases) - [Changelog](https://github.com/awaitility/awaitility/blob/master/changelog.txt) - [Commits](https://github.com/awaitility/awaitility/compare/awaitility-4.1.1...awaitility-4.2.0) --- updated-dependencies: - dependency-name: org.awaitility:awaitility dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 376b17e58b7..52f22e87fab 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ 2.2.1 2.5.3 9.2 - 4.1.1 + 4.2.0 5.3.0 1.5 9.3 From 5b5d9738230dc716e6adfa962cd1161172d7bbcc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Mar 2022 01:18:26 +0000 Subject: [PATCH 11/29] Bump jackson-core from 2.13.1 to 2.13.2 Bumps [jackson-core](https://github.com/FasterXML/jackson-core) from 2.13.1 to 2.13.2. - [Release notes](https://github.com/FasterXML/jackson-core/releases) - [Commits](https://github.com/FasterXML/jackson-core/compare/jackson-core-2.13.1...jackson-core-2.13.2) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1f2e17bbc65..4173b89d52a 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.3.5.Final 11.0.15.Final 2.13.2 - 2.13.1 + 2.13.2 2.13.1 1.2.2 1.3.5 From 7154479b36c58c61d4df341132384d14840baf9d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Mar 2022 09:22:56 +0000 Subject: [PATCH 12/29] Bump wildfly-common from 1.5.4.Final to 1.6.0.Final Bumps wildfly-common from 1.5.4.Final to 1.6.0.Final. --- updated-dependencies: - dependency-name: org.wildfly.common:wildfly-common dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1f2e17bbc65..91c4792dfc6 100644 --- a/pom.xml +++ b/pom.xml @@ -120,7 +120,7 @@ 1.2.5 1.16.3 3.1.9.Final - 1.5.4.Final + 1.6.0.Final 1.18.3.Final 2.4.7 From f7415992a420865b56ca7098e4c6ccba15b83549 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Mar 2022 03:34:26 +0000 Subject: [PATCH 13/29] Bump jackson-databind from 2.13.1 to 2.13.2 Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.1 to 2.13.2. - [Release notes](https://github.com/FasterXML/jackson/releases) - [Commits](https://github.com/FasterXML/jackson/commits) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9be35df0b3c..383bef7de4b 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ 11.0.15.Final 2.13.2 2.13.2 - 2.13.1 + 2.13.2 1.2.2 1.3.5 3.0.3 From b2d3dbf9a48831466c6dcccf770e9d1cc594ff04 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Mar 2022 09:22:01 +0000 Subject: [PATCH 14/29] Bump google-cloud-datastore from 2.2.5 to 2.2.6 Bumps [google-cloud-datastore](https://github.com/googleapis/java-datastore) from 2.2.5 to 2.2.6. - [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.2.5...v2.2.6) --- updated-dependencies: - dependency-name: com.google.cloud:google-cloud-datastore dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- 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 ade22e38a0b..0548d4d3322 100644 --- a/jetty-gcloud/pom.xml +++ b/jetty-gcloud/pom.xml @@ -13,7 +13,7 @@ Jetty :: GCloud - 2.2.5 + 2.2.6 From 9e19979cb2d3766c94fb61bef7500dce0f51529f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Mar 2022 09:22:31 +0000 Subject: [PATCH 15/29] Bump grpc-core from 1.44.1 to 1.45.0 Bumps [grpc-core](https://github.com/grpc/grpc-java) from 1.44.1 to 1.45.0. - [Release notes](https://github.com/grpc/grpc-java/releases) - [Commits](https://github.com/grpc/grpc-java/compare/v1.44.1...v1.45.0) --- updated-dependencies: - dependency-name: io.grpc:grpc-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 383bef7de4b..b28ea14fd7d 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ 7.0.3 3.0.2 2.11.0 - 1.44.1 + 1.45.0 2.9.0 31.1-jre 5.1.0 From 42e4b257e20bb55d466afc996448727f0a1132cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Mar 2022 09:20:14 +0000 Subject: [PATCH 16/29] Bump maven-compiler-plugin from 3.10.0 to 3.10.1 Bumps [maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.10.0 to 3.10.1. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.10.0...maven-compiler-plugin-3.10.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b28ea14fd7d..630714b3e01 100644 --- a/pom.xml +++ b/pom.xml @@ -141,7 +141,7 @@ 5.1.4 3.1.0 3.1.2 - 3.10.0 + 3.10.1 3.2.0 3.0.0-M2 2.10 From bac5751e072f0fa9cdda3c948856eff2523ef762 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Mar 2022 09:21:21 +0000 Subject: [PATCH 17/29] Bump google-cloud-datastore from 2.2.6 to 2.2.8 Bumps [google-cloud-datastore](https://github.com/googleapis/java-datastore) from 2.2.6 to 2.2.8. - [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.2.6...v2.2.8) --- updated-dependencies: - dependency-name: com.google.cloud:google-cloud-datastore dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- 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 0548d4d3322..c1b82352f56 100644 --- a/jetty-gcloud/pom.xml +++ b/jetty-gcloud/pom.xml @@ -13,7 +13,7 @@ Jetty :: GCloud - 2.2.6 + 2.2.8 From c068ea2cb6384d5cf905d570d622bec9a75184ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Mar 2022 09:34:09 +0000 Subject: [PATCH 18/29] Bump maven-dependency-plugin from 3.2.0 to 3.3.0 Bumps [maven-dependency-plugin](https://github.com/apache/maven-dependency-plugin) from 3.2.0 to 3.3.0. - [Release notes](https://github.com/apache/maven-dependency-plugin/releases) - [Commits](https://github.com/apache/maven-dependency-plugin/compare/maven-dependency-plugin-3.2.0...maven-dependency-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-dependency-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 630714b3e01..bedaf5a0c50 100644 --- a/pom.xml +++ b/pom.xml @@ -142,7 +142,7 @@ 3.1.0 3.1.2 3.10.1 - 3.2.0 + 3.3.0 3.0.0-M2 2.10 3.0.0 From c685ead974bb0cb38a14000d55410595d2f32a63 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Mar 2022 09:28:44 +0000 Subject: [PATCH 19/29] Bump google-cloud-datastore from 2.2.8 to 2.2.9 Bumps [google-cloud-datastore](https://github.com/googleapis/java-datastore) from 2.2.8 to 2.2.9. - [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.2.8...v2.2.9) --- updated-dependencies: - dependency-name: com.google.cloud:google-cloud-datastore dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- 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 c1b82352f56..0979e3091de 100644 --- a/jetty-gcloud/pom.xml +++ b/jetty-gcloud/pom.xml @@ -13,7 +13,7 @@ Jetty :: GCloud - 2.2.8 + 2.2.9 From b8c218a3637abed017feb41c4b63c14ed0951f8b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Mar 2022 09:28:55 +0000 Subject: [PATCH 20/29] Bump versions-maven-plugin from 2.9.0 to 2.10.0 Bumps [versions-maven-plugin](https://github.com/mojohaus/versions-maven-plugin) from 2.9.0 to 2.10.0. - [Release notes](https://github.com/mojohaus/versions-maven-plugin/releases) - [Changelog](https://github.com/mojohaus/versions-maven-plugin/blob/master/ReleaseNotes.md) - [Commits](https://github.com/mojohaus/versions-maven-plugin/compare/versions-maven-plugin-2.9.0...versions-maven-plugin-2.10.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:versions-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bedaf5a0c50..091ab849443 100644 --- a/pom.xml +++ b/pom.xml @@ -164,7 +164,7 @@ 3.2.1 3.3.2 4.5.3.0 - 2.9.0 + 2.10.0 false From 48fa202d91c3a5540b403a3756745dca23b1bc4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Mar 2022 09:33:40 +0000 Subject: [PATCH 21/29] Bump org.eclipse.osgi from 3.17.100 to 3.17.200 Bumps org.eclipse.osgi from 3.17.100 to 3.17.200. --- updated-dependencies: - dependency-name: org.eclipse.platform:org.eclipse.osgi dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- jetty-osgi/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetty-osgi/pom.xml b/jetty-osgi/pom.xml index f955fde28fe..c75dade73ce 100644 --- a/jetty-osgi/pom.xml +++ b/jetty-osgi/pom.xml @@ -12,7 +12,7 @@ pom - 3.17.100 + 3.17.200 3.10.200 3.6.100 1.0.0-v20070606 From f667eded0372e86050cb4b91ff655834a95f042c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Mar 2022 09:18:47 +0000 Subject: [PATCH 22/29] Bump maven-jxr-plugin from 3.1.1 to 3.2.0 Bumps [maven-jxr-plugin](https://github.com/apache/maven-jxr) from 3.1.1 to 3.2.0. - [Release notes](https://github.com/apache/maven-jxr/releases) - [Commits](https://github.com/apache/maven-jxr/compare/jxr-3.1.1...jxr-3.2.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-jxr-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 091ab849443..b5768d0b01e 100644 --- a/pom.xml +++ b/pom.xml @@ -152,7 +152,7 @@ 3.2.2 3.2.2 3.3.2 - 3.1.1 + 3.2.0 3.6.4 3.6.4 2.5.3 From c14267d7e4c0d9c8de1a9b653c2fb9839ebefc7a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Mar 2022 09:20:58 +0000 Subject: [PATCH 23/29] Bump wildfly-elytron from 1.18.3.Final to 1.19.0.Final Bumps [wildfly-elytron](https://github.com/wildfly-security/wildfly-elytron) from 1.18.3.Final to 1.19.0.Final. - [Release notes](https://github.com/wildfly-security/wildfly-elytron/releases) - [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/1.18.3.Final...1.19.0.Final) --- updated-dependencies: - dependency-name: org.wildfly.security:wildfly-elytron dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 091ab849443..5ccf32f7874 100644 --- a/pom.xml +++ b/pom.xml @@ -121,7 +121,7 @@ 1.16.3 3.1.9.Final 1.6.0.Final - 1.18.3.Final + 1.19.0.Final 2.4.7 From cab99454309529f1d7c257f8316d92755a1a1b89 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Tue, 22 Mar 2022 09:48:09 +0100 Subject: [PATCH 24/29] Issue #7748 - allow override of path mapping behavior in ServletContextHandler (#7614) Added protected method to ServletHandler to allow other servlet mappings (eg regex) in embedded/extended usage Signed-off-by: Greg Wilkins Signed-off-by: Joakim Erdfelt --- .../jetty/server/ServletPathMapping.java | 7 +- .../eclipse/jetty/servlet/ServletHandler.java | 12 +- .../jetty/servlet/RegexServletTest.java | 153 ++++++++++++++++++ 3 files changed, 163 insertions(+), 9 deletions(-) create mode 100644 jetty-servlet/src/test/java/org/eclipse/jetty/servlet/RegexServletTest.java diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ServletPathMapping.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ServletPathMapping.java index e8574ce2f54..c03607f542e 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ServletPathMapping.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ServletPathMapping.java @@ -86,18 +86,13 @@ public class ServletPathMapping implements HttpServletMapping break; case MIDDLE_GLOB: - _mappingMatch = null; - _matchValue = ""; - _servletPath = pathInContext; - _pathInfo = null; - break; - default: throw new IllegalStateException(); } } else { + // TODO can we do better for RegexPathSpec _mappingMatch = null; _matchValue = ""; _servletPath = pathInContext; diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java index dcafde61e0f..1b0fc85cef7 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java @@ -1246,6 +1246,12 @@ public class ServletHandler extends ScopedHandler } } + protected PathSpec asPathSpec(String pathSpec) + { + // By default only allow servlet path specs + return new ServletPathSpec(pathSpec); + } + protected void updateMappings() { try (AutoLock ignored = lock()) @@ -1354,9 +1360,9 @@ public class ServletHandler extends ScopedHandler finalMapping.getServletName(), getServlet(finalMapping.getServletName()).getSource()); - ServletPathSpec servletPathSpec = new ServletPathSpec(pathSpec); - MappedServlet mappedServlet = new MappedServlet(servletPathSpec, getServlet(finalMapping.getServletName())); - pm.put(servletPathSpec, mappedServlet); + PathSpec ps = asPathSpec(pathSpec); + MappedServlet mappedServlet = new MappedServlet(ps, getServlet(finalMapping.getServletName())); + pm.put(ps, mappedServlet); } _servletPathMap = pm; diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/RegexServletTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/RegexServletTest.java new file mode 100644 index 00000000000..1940308cbc3 --- /dev/null +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/RegexServletTest.java @@ -0,0 +1,153 @@ +// +// ======================================================================== +// Copyright (c) 1995-2022 Mort Bay Consulting Pty Ltd and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 +// which is available at https://www.apache.org/licenses/LICENSE-2.0. +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// ======================================================================== +// + +package org.eclipse.jetty.servlet; + +import java.io.IOException; +import java.io.PrintWriter; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.eclipse.jetty.http.pathmap.PathMappings; +import org.eclipse.jetty.http.pathmap.PathSpec; +import org.eclipse.jetty.server.LocalConnector; +import org.eclipse.jetty.server.Server; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsString; + +public class RegexServletTest +{ + private Server _server; + private LocalConnector _connector; + private ServletContextHandler _servletContextHandler; + + @BeforeEach + public void beforeEach() + { + _server = new Server(); + _connector = new LocalConnector(_server); + + _servletContextHandler = new ServletContextHandler(_server, "/ctx"); + _servletContextHandler.setServletHandler(new ServletHandler() + { + @Override + protected PathSpec asPathSpec(String pathSpec) + { + return PathMappings.asPathSpec(pathSpec); + } + }); + + _server.setHandler(_servletContextHandler); + _server.addConnector(_connector); + } + + @Test + public void testHello() throws Exception + { + _servletContextHandler.addServlet(new ServletHolder(new ServletContextHandlerTest.HelloServlet()), "^/[Hh]ello"); + _server.start(); + + assertThat(_connector.getResponse("GET /ctx/hello HTTP/1.0\r\n\r\n"), containsString("Hello World")); + assertThat(_connector.getResponse("GET /ctx/Hello HTTP/1.0\r\n\r\n"), containsString("Hello World")); + assertThat(_connector.getResponse("GET /ctx/HELLO HTTP/1.0\r\n\r\n"), containsString(" 404")); + } + + @Test + public void testMapping() throws Exception + { + _servletContextHandler.addServlet(new ServletHolder(new TestServlet()), "^/test/.*$"); + _server.start(); + + String response = _connector.getResponse("GET /ctx/test/info HTTP/1.0\r\n\r\n"); + assertThat(response, containsString(" 200 OK")); + assertThat(response, containsString("contextPath='/ctx'")); + assertThat(response, containsString("servletPath='/test/info'")); + assertThat(response, containsString("pathInfo='null'")); + assertThat(response, containsString("mapping.mappingMatch='null'")); + assertThat(response, containsString("mapping.matchValue=''")); + assertThat(response, containsString("mapping.pattern='^/test/.*$'")); + } + + @Test + public void testForward() throws Exception + { + _servletContextHandler.addServlet(new ServletHolder(new ForwardServlet()), "^/forward(/.*)?"); + _servletContextHandler.addServlet(new ServletHolder(new TestServlet()), "^/[Tt]est(/.*)?"); + _server.start(); + + String response = _connector.getResponse("GET /ctx/forward/ignore HTTP/1.0\r\n\r\n"); + assertThat(response, containsString(" 200 OK")); + assertThat(response, containsString("contextPath='/ctx'")); + assertThat(response, containsString("servletPath='/Test/info'")); + assertThat(response, containsString("pathInfo='null'")); + assertThat(response, containsString("mapping.mappingMatch='null'")); + assertThat(response, containsString("mapping.matchValue=''")); + assertThat(response, containsString("mapping.pattern='^/[Tt]est(/.*)?'")); + } + + @Test + public void testInclude() throws Exception + { + _servletContextHandler.addServlet(new ServletHolder(new IncludeServlet()), "^/include$"); + _servletContextHandler.addServlet(new ServletHolder(new TestServlet()), "^/[Tt]est(/.*)?"); + _server.start(); + + String response = _connector.getResponse("GET /ctx/include HTTP/1.0\r\n\r\n"); + assertThat(response, containsString(" 200 OK")); + assertThat(response, containsString("contextPath='/ctx'")); + assertThat(response, containsString("servletPath='/include'")); + assertThat(response, containsString("pathInfo='null'")); + assertThat(response, containsString("mapping.mappingMatch='null'")); + assertThat(response, containsString("mapping.matchValue=''")); + assertThat(response, containsString("mapping.pattern='^/include$'")); + } + + static class TestServlet extends HttpServlet + { + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException + { + resp.setStatus(200); + PrintWriter out = resp.getWriter(); + out.printf("contextPath='%s'%n", req.getContextPath()); + out.printf("servletPath='%s'%n", req.getServletPath()); + out.printf("pathInfo='%s'%n", req.getPathInfo()); + out.printf("mapping.mappingMatch='%s'%n", req.getHttpServletMapping().getMappingMatch()); + out.printf("mapping.matchValue='%s'%n", req.getHttpServletMapping().getMatchValue()); + out.printf("mapping.pattern='%s'%n", req.getHttpServletMapping().getPattern()); + } + } + + static class ForwardServlet extends HttpServlet + { + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException + { + req.getServletContext().getRequestDispatcher("/Test/info").forward(req, resp); + } + } + + static class IncludeServlet extends HttpServlet + { + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException + { + req.getServletContext().getRequestDispatcher("/Test/info").include(req, resp); + } + } +} From ae5c8e34e7dd4f5cce5f649e48469ba3bbc51d91 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Tue, 22 Mar 2022 10:02:32 -0500 Subject: [PATCH 25/29] Issue #7617 - RequestLog content params extraction prevention (#7618) --- .../java/org/eclipse/jetty/server/Request.java | 4 +++- .../org/eclipse/jetty/server/RequestLogTest.java | 14 ++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java index 43f38a6e40e..777eb139488 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java @@ -1435,8 +1435,10 @@ public class Request implements HttpServletRequest RequestLog requestLog = httpChannel.getRequestLog(); if (requestLog != null) { - // Don't allow pulling more parameters + // Don't allow pulling more parameters from request body content _contentParamsExtracted = true; + if (_contentParameters == null) + _contentParameters = NO_PARAMS; // Reset the status code to what was committed MetaData.Response committedResponse = getResponse().getCommittedMetaData(); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/RequestLogTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/RequestLogTest.java index 440650475e1..f0043415121 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/RequestLogTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/RequestLogTest.java @@ -34,6 +34,8 @@ import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.component.LifeCycle; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -145,8 +147,9 @@ public class RequestLogTest * Test an unread HTTP/1.1 POST, it has valid body content, the dispatched Handler on the server doesn't read the POST body content. * The RequestLog accidentally attempts to read the Request body content due to the use of Request.getParameterNames() API. */ - @Test - public void testNormalPostFormRequest() throws Exception + @ParameterizedTest + @ValueSource(strings = {"/hello", "/hello?a=b"}) + public void testNormalPostFormRequest(String requestPath) throws Exception { Server server = null; try @@ -179,7 +182,7 @@ public class RequestLogTest byte[] bufForm = form.toString().getBytes(UTF_8); StringBuilder req = new StringBuilder(); - req.append("POST /hello HTTP/1.1\r\n"); + req.append("POST ").append(requestPath).append(" HTTP/1.1\r\n"); req.append("Host: ").append(baseURI.getRawAuthority()).append("\r\n"); req.append("Content-Type: ").append(MimeTypes.Type.FORM_ENCODED).append("\r\n"); req.append("Content-Length: ").append(bufForm.length).append("\r\n"); @@ -213,7 +216,10 @@ public class RequestLogTest assertThat("Body Content", bodyContent, containsString("Got POST to /hello")); String reqlog = requestLogLines.poll(5, TimeUnit.SECONDS); - assertThat("RequestLog", reqlog, containsString("method:POST|uri:/hello|paramNames.size:0|status:200")); + int querySize = 0; + if (requestPath.contains("?")) + querySize = 1; // assuming that parameterized version only has 1 query value + assertThat("RequestLog", reqlog, containsString("method:POST|uri:/hello|paramNames.size:" + querySize + "|status:200")); } } finally From e0788ab0564ad2acfb2c082720f9c237f2380063 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Tue, 22 Mar 2022 19:45:27 +0100 Subject: [PATCH 26/29] Fix #7615 encode relative URIs (#7765) * Fix #7615 encode relative URIs cherry-picked from 9c30caf2478ba144ec6a61e7c2a4da791963ce9d Signed-off-by: Greg Wilkins * Fix #7615 encode relative URIs fixed checkstyle Signed-off-by: Greg Wilkins --- .../org/eclipse/jetty/server/Response.java | 32 ++++++++++--------- .../eclipse/jetty/server/ResponseTest.java | 3 +- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java index 1a4688c8eda..62eb329b0c8 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java @@ -342,6 +342,9 @@ public class Response implements HttpServletResponse @Override public String encodeURL(String url) { + if (url == null) + return null; + final Request request = _channel.getRequest(); SessionHandler sessionManager = request.getSessionHandler(); @@ -349,7 +352,8 @@ public class Response implements HttpServletResponse return url; HttpURI uri = null; - if (sessionManager.isCheckingRemoteSessionIdEncoding() && URIUtil.hasScheme(url)) + boolean hasScheme = URIUtil.hasScheme(url); + if (sessionManager.isCheckingRemoteSessionIdEncoding() && hasScheme) { uri = HttpURI.from(url); String path = uri.getPath(); @@ -371,9 +375,6 @@ public class Response implements HttpServletResponse if (sessionURLPrefix == null) return url; - if (url == null) - return null; - // should not encode if cookies in evidence if ((sessionManager.isUsingCookies() && request.isRequestedSessionIdFromCookie()) || !sessionManager.isUsingURLs()) { @@ -404,9 +405,6 @@ public class Response implements HttpServletResponse String id = sessionManager.getExtendedId(session); - if (uri == null) - uri = HttpURI.from(url); - // Already encoded int prefix = url.indexOf(sessionURLPrefix); if (prefix != -1) @@ -421,20 +419,24 @@ public class Response implements HttpServletResponse url.substring(suffix); } + // check for a null path + String nonNullPath = ""; + if (hasScheme) + { + if (uri == null) + uri = HttpURI.from(url); + if (uri.getPath() == null) + nonNullPath = "/"; + } + // edit the session int suffix = url.indexOf('?'); if (suffix < 0) suffix = url.indexOf('#'); if (suffix < 0) - { - return url + - ((HttpScheme.HTTPS.is(uri.getScheme()) || HttpScheme.HTTP.is(uri.getScheme())) && uri.getPath() == null ? "/" : "") + //if no path, insert the root path - sessionURLPrefix + id; - } + return url + nonNullPath + sessionURLPrefix + id; - return url.substring(0, suffix) + - ((HttpScheme.HTTPS.is(uri.getScheme()) || HttpScheme.HTTP.is(uri.getScheme())) && uri.getPath() == null ? "/" : "") + //if no path so insert the root path - sessionURLPrefix + id + url.substring(suffix); + return url.substring(0, suffix) + nonNullPath + sessionURLPrefix + id + url.substring(suffix); } @Override diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ResponseTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ResponseTest.java index c392ae7126f..2e9b9fcb27c 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ResponseTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ResponseTest.java @@ -1642,7 +1642,7 @@ public class ResponseTest } @Test - public void testEncodeRedirect() + public void testEncodeURLs() { ContextHandler context = new ContextHandler("/path"); Response response = getResponse(); @@ -1708,6 +1708,7 @@ public class ResponseTest assertEquals("/;jsessionid=12345", response.encodeURL("/")); assertEquals("/foo.html;jsessionid=12345#target", response.encodeURL("/foo.html#target")); assertEquals(";jsessionid=12345", response.encodeURL("")); + assertEquals("../foo/bar.jsp;jsessionid=12345", response.encodeURL("../foo/bar.jsp")); } @Test From 7b648f6d5caf118c654ef6a7f83473f7912c404c Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Wed, 23 Mar 2022 19:06:39 +0100 Subject: [PATCH 27/29] Fixes #7548 - Interrupt flag is not always cleared in between requests. (#7563) Now clearing the interrupt flag. Signed-off-by: Simone Bordet --- .../eclipse/jetty/util/thread/ReservedThreadExecutor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ReservedThreadExecutor.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ReservedThreadExecutor.java index b9d88dc8a62..1e0e8377c43 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ReservedThreadExecutor.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ReservedThreadExecutor.java @@ -410,6 +410,11 @@ public class ReservedThreadExecutor extends AbstractLifeCycle implements TryExec { LOG.warn("Unable to run task", e); } + finally + { + // Clear any interrupted status. + Thread.interrupted(); + } } } finally @@ -431,4 +436,4 @@ public class ReservedThreadExecutor extends AbstractLifeCycle implements TryExec _thread); } } -} \ No newline at end of file +} From 9da5c21ea370f22cfc148851c0785e4c0c3f2244 Mon Sep 17 00:00:00 2001 From: ianrifkin Date: Wed, 23 Mar 2022 14:25:34 -0400 Subject: [PATCH 28/29] Issue #7182 having running() delete the state file where it previously only deleted the pid file. (#7184) * Issue #7182 changing approach from deleting the state file consistently to simply grep'ing for last line in JETTY_STATE file Signed-off-by: Ian Rifkin --- jetty-home/src/main/resources/bin/jetty.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jetty-home/src/main/resources/bin/jetty.sh b/jetty-home/src/main/resources/bin/jetty.sh index 1158a0ae04c..1c389045853 100755 --- a/jetty-home/src/main/resources/bin/jetty.sh +++ b/jetty-home/src/main/resources/bin/jetty.sh @@ -136,9 +136,9 @@ started() for ((T = 0; T < $(($3 / 4)); T++)) do sleep 4 - [ -z "$(grep STARTED $1 2>/dev/null)" ] || return 0 - [ -z "$(grep STOPPED $1 2>/dev/null)" ] || return 1 - [ -z "$(grep FAILED $1 2>/dev/null)" ] || return 1 + [ -z "$(tail -1 $1 | grep STARTED 2>/dev/null)" ] || return 0 + [ -z "$(tail -1 $1 | grep STOPPED 2>/dev/null)" ] || return 1 + [ -z "$(tail -1 $1 | grep FAILED 2>/dev/null)" ] || return 1 local PID=$(cat "$2" 2>/dev/null) || return 1 kill -0 "$PID" 2>/dev/null || return 1 echo -n ". " From b419a8956e504050227a6718a5caff8cb4437202 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Wed, 23 Mar 2022 16:02:35 -0500 Subject: [PATCH 29/29] Issue #6879 - Remove jminix (#7770) Signed-off-by: Joakim Erdfelt --- .../src/main/resources/modules/jminix.mod | 46 ------------------- .../main/resources/modules/jminix/jminix.xml | 12 ----- .../distribution/ThirdPartyModulesTests.java | 34 -------------- 3 files changed, 92 deletions(-) delete mode 100644 jetty-home/src/main/resources/modules/jminix.mod delete mode 100644 jetty-home/src/main/resources/modules/jminix/jminix.xml diff --git a/jetty-home/src/main/resources/modules/jminix.mod b/jetty-home/src/main/resources/modules/jminix.mod deleted file mode 100644 index c3d6f7f71bb..00000000000 --- a/jetty-home/src/main/resources/modules/jminix.mod +++ /dev/null @@ -1,46 +0,0 @@ -# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Deploys the Jminix JMX Console within the server. - -[tags] -3rdparty - -[depend] -stats -jmx -commons-logging - -[xml] -etc/jminix.xml - -[files] -lib/jminix/ -maven://org.jminix/jminix/1.1.0|lib/jminix/jminix-1.1.0.jar -https://maven.restlet.talend.com/org/restlet/org.restlet/1.1.5/org.restlet-1.1.5.jar|lib/jminix/org.restlet-1.1.5.jar -https://maven.restlet.talend.com/org/restlet/org.restlet.ext.velocity/1.1.5/org.restlet.ext.velocity-1.1.5.jar|lib/jminix/org.restlet.ext.velocity-1.1.5.jar -maven://org.apache.velocity/velocity/1.5|lib/jminix/velocity-1.5.jar -maven://oro/oro/2.0.8|lib/jminix/oro-2.0.8.jar -https://maven.restlet.talend.com/com/noelios/restlet/com.noelios.restlet/1.1.5/com.noelios.restlet-1.1.5.jar|lib/jminix/com.noelios.restlet-1.1.5.jar -https://maven.restlet.talend.com/com/noelios/restlet/com.noelios.restlet.ext.servlet/1.1.5/com.noelios.restlet.ext.servlet-1.1.5.jar|lib/jminix/com.noelios.restlet.ext.servlet-1.1.5.jar -maven://net.sf.json-lib/json-lib/2.2.3/jar/jdk15|lib/jminix/json-lib-2.2.3-jdk15.jar -maven://commons-lang/commons-lang/2.4|lib/jminix/commons-lang-2.4.jar -maven://commons-beanutils/commons-beanutils/1.7.0|lib/jminix/commons-beanutils-1.7.0.jar -maven://commons-collections/commons-collections/3.2|lib/jminix/commons-collections-3.2.jar -maven://net.sf.ezmorph/ezmorph/1.0.6|lib/jminix/ezmorph-1.0.6.jar -maven://org.jgroups/jgroups/2.12.1.3.Final|lib/jminix/jgroups-2.12.1.3.Final.jar -maven://org.jasypt/jasypt/1.8|lib/jminix/jasypt-1.8.jar -basehome:modules/jminix/jminix.xml|etc/jminix.xml - -[lib] -lib/jminix/**.jar - -[license] -JMiniX is a hosted at google code and released under the Apache License 2.0 -https://code.google.com/p/jminix/ -http://www.apache.org/licenses/LICENSE-2.0 - -[ini-template] -## Jminix Configuration -# jminix.port=8088 - diff --git a/jetty-home/src/main/resources/modules/jminix/jminix.xml b/jetty-home/src/main/resources/modules/jminix/jminix.xml deleted file mode 100644 index 933de82b697..00000000000 --- a/jetty-home/src/main/resources/modules/jminix/jminix.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/ThirdPartyModulesTests.java b/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/ThirdPartyModulesTests.java index 9b8d44154f3..15151871aa7 100644 --- a/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/ThirdPartyModulesTests.java +++ b/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/ThirdPartyModulesTests.java @@ -105,40 +105,6 @@ public class ThirdPartyModulesTests extends AbstractJettyHomeTest } } - @Test - public void testjminix() throws Exception - { - Path jettyBase = newTestJettyBaseDirectory(); - String jettyVersion = System.getProperty("jettyVersion"); - JettyHomeTester distribution = JettyHomeTester.Builder.newInstance() - .jettyVersion(jettyVersion) - .jettyBase(jettyBase) - .mavenLocalRepository(System.getProperty("mavenRepoPath")) - .build(); - - int httpPort = distribution.freePort(); - - String[] argsConfig = { - "--approve-all-licenses", - "--add-modules=jminix,http,logging-jcl-capture" - }; - - try (JettyHomeTester.Run runConfig = distribution.start(argsConfig)) - { - assertTrue(runConfig.awaitFor(2, TimeUnit.MINUTES)); - assertEquals(0, runConfig.getExitValue()); - - String[] argsStart = { - "jetty.http.port=" + httpPort - }; - - try (JettyHomeTester.Run runStart = distribution.start(argsStart)) - { - assertTrue(runStart.awaitConsoleLogsFor("Started Server@", 20, TimeUnit.SECONDS)); - } - } - } - @Test public void testjolokia() throws Exception {