You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2026/10/15 21:14:54 UTC
(tomcat) 02/02: Fix backports
This is an automated email from the ASF dual-hosted git repository.
rmaucher pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 787dee631d975b1f43416cc44fbf43d992627cc0
Author: remm <re...@apache.org>
AuthorDate: Thu Oct 15 23:14:38 2026 +0200
Fix backports
---
.../catalina/valves/TestParameterLimitValve.java | 4 ++++
.../apache/catalina/valves/TestRemoteIpValve.java | 1 +
.../tomcat/util/descriptor/web/TestWebXml.java | 8 ++++----
.../digester/TestServiceBindingPropertySource.java | 24 +++++++++++-----------
4 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/test/org/apache/catalina/valves/TestParameterLimitValve.java b/test/org/apache/catalina/valves/TestParameterLimitValve.java
index 1aa6263b45..e260d4a4bf 100644
--- a/test/org/apache/catalina/valves/TestParameterLimitValve.java
+++ b/test/org/apache/catalina/valves/TestParameterLimitValve.java
@@ -633,6 +633,8 @@ public class TestParameterLimitValve extends TomcatBaseTest {
ctx.addServletMapping("/special/endpoint", "snoop");
ctx.addServletMapping("/other/endpoint", "snoop");
+ addFailedRequestFilter(ctx);
+
tomcat.start();
int rc = getUrl("http://localhost:" + getPort() +
@@ -670,6 +672,8 @@ public class TestParameterLimitValve extends TomcatBaseTest {
Tomcat.addServlet(ctx, "snoop", new SnoopServlet());
ctx.addServletMapping("/special/endpoint", "snoop");
+ addFailedRequestFilter(ctx);
+
tomcat.start();
int rc = getUrl("http://localhost:" + getPort() +
diff --git a/test/org/apache/catalina/valves/TestRemoteIpValve.java b/test/org/apache/catalina/valves/TestRemoteIpValve.java
index df349e8dfe..cab8427463 100644
--- a/test/org/apache/catalina/valves/TestRemoteIpValve.java
+++ b/test/org/apache/catalina/valves/TestRemoteIpValve.java
@@ -167,6 +167,7 @@ public class TestRemoteIpValve {
remoteIpValve.setNext(remoteAddrAndHostTrackerValve);
Request request = new MockRequest();
+ request.setCoyoteRequest(new org.apache.coyote.Request());
request.setRemoteAddr("192.168.0.10");
request.setRemoteHost("remote-host-original-value");
request.getCoyoteRequest().getMimeHeaders().addValue("x-forwarded-for").setString(" ");
diff --git a/test/org/apache/tomcat/util/descriptor/web/TestWebXml.java b/test/org/apache/tomcat/util/descriptor/web/TestWebXml.java
index 1d5c1ce83b..9620519565 100644
--- a/test/org/apache/tomcat/util/descriptor/web/TestWebXml.java
+++ b/test/org/apache/tomcat/util/descriptor/web/TestWebXml.java
@@ -716,11 +716,11 @@ public class TestWebXml {
// port-component-ref entries which were historically stored in the
// same map.
String input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<web-app xmlns=\"https://jakarta.ee/xml/ns/jakartaee\"\n" +
+ "<web-app xmlns=\"http://xmlns.jcp.org/xml/ns/javaee\"\n" +
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
- " xsi:schemaLocation=\"https://jakarta.ee/xml/ns/jakartaee" +
- " https://jakarta.ee/xml/ns/jakartaee/web-app_6_1.xsd\"\n" +
- " version=\"6.1\"\n" +
+ " xsi:schemaLocation=\"http://xmlns.jcp.org/xml/ns/javaee" +
+ " http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd\"\n" +
+ " version=\"4.0\"\n" +
" metadata-complete=\"true\">\n" +
"\n" +
" <service-ref>\n" +
diff --git a/test/org/apache/tomcat/util/digester/TestServiceBindingPropertySource.java b/test/org/apache/tomcat/util/digester/TestServiceBindingPropertySource.java
index 3a7e8d43fa..5af6f80725 100644
--- a/test/org/apache/tomcat/util/digester/TestServiceBindingPropertySource.java
+++ b/test/org/apache/tomcat/util/digester/TestServiceBindingPropertySource.java
@@ -49,8 +49,8 @@ public class TestServiceBindingPropertySource {
ServiceBindingPropertySource source =
new ServiceBindingPropertySource(temporaryFolder.getRoot().getAbsolutePath());
- Assert.assertEquals(value, source.getProperty("my-binding.keyPassword"));
- Assert.assertEquals(value, source.getProperty("chomp:my-binding.withNewline"));
+ Assert.assertEquals(value, source.getProperty("my-binding.keyPassword", null));
+ Assert.assertEquals(value, source.getProperty("chomp:my-binding.withNewline", null));
}
@@ -66,12 +66,12 @@ public class TestServiceBindingPropertySource {
ServiceBindingPropertySource source =
new ServiceBindingPropertySource(temporaryFolder.getRoot().getAbsolutePath());
- Assert.assertEquals("value", source.getProperty("chomp:my-binding.lf"));
- Assert.assertEquals("value", source.getProperty("chomp:my-binding.crlf"));
- Assert.assertEquals("value", source.getProperty("chomp:my-binding.cr"));
- Assert.assertEquals("value", source.getProperty("chomp:my-binding.none"));
- Assert.assertEquals("value\n", source.getProperty("chomp:my-binding.blankline"));
- Assert.assertEquals("value ", source.getProperty("chomp:my-binding.trailingspace"));
+ Assert.assertEquals("value", source.getProperty("chomp:my-binding.lf", null));
+ Assert.assertEquals("value", source.getProperty("chomp:my-binding.crlf", null));
+ Assert.assertEquals("value", source.getProperty("chomp:my-binding.cr", null));
+ Assert.assertEquals("value", source.getProperty("chomp:my-binding.none", null));
+ Assert.assertEquals("value\n", source.getProperty("chomp:my-binding.blankline", null));
+ Assert.assertEquals("value ", source.getProperty("chomp:my-binding.trailingspace", null));
}
@@ -82,10 +82,10 @@ public class TestServiceBindingPropertySource {
ServiceBindingPropertySource source =
new ServiceBindingPropertySource(temporaryFolder.getRoot().getAbsolutePath());
- Assert.assertNull(source.getProperty("my-binding.unknown"));
- Assert.assertNull(source.getProperty("unknown-binding.known"));
+ Assert.assertNull(source.getProperty("my-binding.unknown", null));
+ Assert.assertNull(source.getProperty("unknown-binding.known", null));
// A key without exactly one dot is outside the <binding-name>.<key> contract
- Assert.assertNull(source.getProperty("no-dot"));
- Assert.assertNull(source.getProperty("too.many.dots"));
+ Assert.assertNull(source.getProperty("no-dot", null));
+ Assert.assertNull(source.getProperty("too.many.dots", null));
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org