(tomcat) branch main updated: Checkstyle and comment

2024-09-27 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
 new 64a7cfbd52 Checkstyle and comment
64a7cfbd52 is described below

commit 64a7cfbd5265a47cccb712d9f88f8ae6de6ae411
Author: remm 
AuthorDate: Fri Sep 27 10:23:34 2024 +0200

Checkstyle and comment
---
 test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java 
b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
index 2b24015b63..c748711c0f 100644
--- a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
+++ b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
@@ -40,11 +40,11 @@ import org.apache.catalina.startup.TesterMapRealm;
 import org.apache.catalina.startup.TesterServlet;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.tomcat.util.buf.ByteChunk;
 import org.apache.tomcat.util.descriptor.web.LoginConfig;
 import org.apache.tomcat.util.descriptor.web.SecurityCollection;
 import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
 import org.apache.tomcat.websocket.server.WsContextListener;
-import org.apache.tomcat.util.buf.ByteChunk;
 
 /*
  * Test FORM authentication for sessions that do and do not use cookies.
@@ -222,7 +222,7 @@ public class TestFormAuthenticatorA extends TomcatBaseTest {
 
 
 /*
- * Test to ensure that the Expir and 
+ * Test to ensure that the expire and date headers use a GMT date.
  */
 @Test
 public void testDateAndExpireHeadersUseGMT() throws Exception {
@@ -235,7 +235,7 @@ public class TestFormAuthenticatorA extends TomcatBaseTest {
 ctxt.getPipeline().addValve(form);
 tomcat.start();
 
-Map> responseHeaders = new HashMap();
+Map> responseHeaders = new HashMap<>();
 ByteChunk bc = new ByteChunk();
 String path = "http://localhost:"; + getPort() + 
"/examples/jsp/security/protected/index.jsp";
 int rc = getUrl(path, bc, responseHeaders);


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [PR] Add ParameterLimitValve to enforce request parameter limits for specific URLs [tomcat]

2024-09-27 Thread via GitHub


dsoumis commented on PR #753:
URL: https://github.com/apache/tomcat/pull/753#issuecomment-2379031764

   I have refactored the valve and the request as discussed here.
   There were 2 failing tests after the change to Request's constructor which 
introduced method accessing of Connector. 
   The change at TestPersistentManager.java is just a reordering of when the 
mock Connector object is activated.
   Regarding TestSSLValve.java, I introduced a singleton implementation of 
Mockrequest giving more flexibility for Connector values. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [PR] Add ParameterLimitValve to enforce request parameter limits for specific URLs [tomcat]

2024-09-27 Thread via GitHub


dsoumis commented on code in PR #753:
URL: https://github.com/apache/tomcat/pull/753#discussion_r1778454482


##
test/org/apache/catalina/valves/TestSSLValve.java:
##
@@ -314,12 +352,14 @@ public void testSslCipherUserKeySizeHeaderPresent() 
throws Exception {
 
 @Test(expected = NumberFormatException.class)
 public void testSslCipherUserKeySizeHeaderBadFormat() throws Exception {
+setUp();
 mockRequest.setHeader(valve.getSslCipherUserKeySizeHeader(), 
"not-an-integer");
 
 try {
 valve.invoke(mockRequest, null);
 } catch (NumberFormatException e) {
 Assert.assertNull(mockRequest.getAttribute(Globals.KEY_SIZE_ATTR));
+mockRequest.setHeader(valve.getSslCipherUserKeySizeHeader(), null);

Review Comment:
   Due to the random ordering of the execution of the tests, I had to reset the 
header at this point because other tests were throwing NumberFormatException.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 69348] New: Optimizable memory allocation in ELContext

2024-09-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69348

Bug ID: 69348
   Summary: Optimizable memory allocation in ELContext
   Product: Tomcat 9
   Version: 9.0.x
  Hardware: All
OS: Windows XP
Status: NEW
  Severity: normal
  Priority: P2
 Component: EL
  Assignee: dev@tomcat.apache.org
  Reporter: jeng...@amazon.com
  Target Milestone: -

Heap dumps of the recently-added
org.apache.el.parser.TestELParserPerformance.testAstNotEmpty() and testAstAnd()
show extremely high memory usage, which I tracked down to the allocation of
ELContext.lambdaArguments.  Specifically, this field is eagerly initialized via
"new ArrayDeque()".  The default size calculation changes across JVM version so
details may vary - however it looks like 16 is the most probable.

In this particular test, lambdaArguments is never used.  Lazy-initializing this
field such as:

private Deque> getLambdaArguments() {
if (lambdaArguments == null) {
lambdaArguments = new ArrayDeque<>(2);
}

return lambdaArguments;
}

cuts the memory allocated during these tests by over 50%.

In addition to lazy loads, a more conservative size will reduce allocation even
when the object is used.  For example, the sample above uses 2, although that
is probably not the right value for the real world.

Expected impact is a huge reduction in memory allocation while processing EL
expressions.  The rare few Ast* nodes that require the lambdaArguments field
will also improve based on a more conservative allocation size.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [SECURITY] CVE-2024-38286 Apache Tomcat - Denial of Service

2024-09-27 Thread Rémy Maucherat
On Fri, Sep 27, 2024 at 8:37 PM Amarendra Godbole
 wrote:
>
> On Mon, Sep 23, 2024 at 5:54 AM Mark Thomas  wrote:
> >
> > CVE-2024-38286 Apache Tomcat - Denial of Service
> >
> > Severity: Important
> >
> > Vendor: The Apache Software Foundation
> >
> > Versions Affected:
> > Apache Tomcat 11.0.0-M1 to 11.0.0-M20
> > Apache Tomcat 10.1.0-M1 to 10.1.24
> > Apache Tomcat 9.0.13 to 9.0.89
> >
> > Description:
> > Tomcat, under certain configurations on any platform, allows an attacker
> > to cause an OutOfMemoryError by abusing the TLS handshake process.
> >
> > Mitigation:
> > Users of the affected versions should apply one of the following
> > mitigations:
> > - Upgrade to Apache Tomcat 11.0.0-M21 or later
> > - Upgrade to Apache Tomcat 10.1.25 or later
> > - Upgrade to Apache Tomcat 9.0.90 or later
> >
> > Credit:
> > This vulnerability was reported responsibly to the Tomcat security team
> > by Ozaki, North Grid Corporation
> >
> > History:
> > 2024-07-03 Original advisory
> [...]
>
> Based on the commit [1], is it safe to assume the issue only impacts
> when TLS 1.3 is being used?

That is correct.

Rémy

> Thanks.
>
> -Amarendra
>
> [1] 
> https://github.com/apache/tomcat/commit/76c5cce6f0bcef14b0c21c38910371ca7d322d13
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Buildbot failure in on tomcat-11.0.x

2024-09-27 Thread buildbot
Build status: BUILD FAILED: failed Snapshot deployed to ASF Maven snapshot 
repository (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/112/builds/1299
Blamelist: Paul Lodge , remm 
Build Text: failed Snapshot deployed to ASF Maven snapshot repository (failure)
Status Detected: new failure
Build Source Stamp: [branch 11.0.x] bacf851c40f7ac00a154defe6a784bdb2e34e371


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  shell_6: 0

  compile: 1

  shell_7: 0

  shell_8: 0

  shell_9: 2


-- ASF Buildbot


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [SECURITY] CVE-2024-38286 Apache Tomcat - Denial of Service

2024-09-27 Thread Amarendra Godbole
On Mon, Sep 23, 2024 at 5:54 AM Mark Thomas  wrote:
>
> CVE-2024-38286 Apache Tomcat - Denial of Service
>
> Severity: Important
>
> Vendor: The Apache Software Foundation
>
> Versions Affected:
> Apache Tomcat 11.0.0-M1 to 11.0.0-M20
> Apache Tomcat 10.1.0-M1 to 10.1.24
> Apache Tomcat 9.0.13 to 9.0.89
>
> Description:
> Tomcat, under certain configurations on any platform, allows an attacker
> to cause an OutOfMemoryError by abusing the TLS handshake process.
>
> Mitigation:
> Users of the affected versions should apply one of the following
> mitigations:
> - Upgrade to Apache Tomcat 11.0.0-M21 or later
> - Upgrade to Apache Tomcat 10.1.25 or later
> - Upgrade to Apache Tomcat 9.0.90 or later
>
> Credit:
> This vulnerability was reported responsibly to the Tomcat security team
> by Ozaki, North Grid Corporation
>
> History:
> 2024-07-03 Original advisory
[...]

Based on the commit [1], is it safe to assume the issue only impacts
when TLS 1.3 is being used?

Thanks.

-Amarendra

[1] 
https://github.com/apache/tomcat/commit/76c5cce6f0bcef14b0c21c38910371ca7d322d13

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 01/02: Added a unit test to make sure that the Expires and Date headers have consisent formatting and contain GMT

2024-09-27 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit e36a358ef7ae908acb9f51274fdf2bfb796288aa
Author: Paul Lodge 
AuthorDate: Tue Sep 17 16:39:58 2024 +0200

Added a unit test to make sure that the Expires and Date headers have 
consisent formatting and contain GMT
---
 .../authenticator/TestFormAuthenticatorA.java  | 37 ++
 1 file changed, 37 insertions(+)

diff --git a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java 
b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
index 2671b3e1cb..2b24015b63 100644
--- a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
+++ b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
@@ -18,8 +18,12 @@ package org.apache.catalina.authenticator;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.StringTokenizer;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import jakarta.servlet.ServletException;
 import jakarta.servlet.http.HttpServlet;
@@ -40,6 +44,7 @@ import org.apache.tomcat.util.descriptor.web.LoginConfig;
 import org.apache.tomcat.util.descriptor.web.SecurityCollection;
 import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
 import org.apache.tomcat.websocket.server.WsContextListener;
+import org.apache.tomcat.util.buf.ByteChunk;
 
 /*
  * Test FORM authentication for sessions that do and do not use cookies.
@@ -216,6 +221,38 @@ public class TestFormAuthenticatorA extends TomcatBaseTest 
{
 }
 
 
+/*
+ * Test to ensure that the Expir and 
+ */
+@Test
+public void testDateAndExpireHeadersUseGMT() throws Exception {
+Tomcat tomcat = getTomcatInstance();
+
+File appDir = new File(getBuildDirectory(), "webapps/examples");
+Context ctxt  = tomcat.addWebapp(null, "/examples", 
appDir.getAbsolutePath());
+FormAuthenticator form = new FormAuthenticator();
+form.setSecurePagesWithPragma(true);
+ctxt.getPipeline().addValve(form);
+tomcat.start();
+
+Map> responseHeaders = new HashMap();
+ByteChunk bc = new ByteChunk();
+String path = "http://localhost:"; + getPort() + 
"/examples/jsp/security/protected/index.jsp";
+int rc = getUrl(path, bc, responseHeaders);
+Assert.assertTrue(String.format("Expecting 200, but got ", rc), rc == 
200);
+String expiresDate = responseHeaders.get("Expires").get(0).toString();
+
+String ExpectedDateFormatRegx = "^[A-za-z]{3}, \\d{2} \\w{3} \\d{4} 
\\d{2}:\\d{2}:\\d{2} GMT$";
+Pattern pattern = Pattern.compile(ExpectedDateFormatRegx);
+Matcher matcher = pattern.matcher((CharSequence)expiresDate);
+Assert.assertTrue("Expires header date not in expected format", 
matcher.matches());
+
+String Date = responseHeaders.get("Date").get(0).toString();
+matcher = pattern.matcher((CharSequence)Date);
+Assert.assertTrue("Date header not in expected format", 
matcher.matches());
+}
+
+
 /*
  * Choreograph the steps of the test dialogue with the server
  *  1. while not authenticated, try to access a protected resource


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 11.0.x updated (b5d8092cd8 -> bacf851c40)

2024-09-27 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a change to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


from b5d8092cd8 Always use code blocks
 new e36a358ef7 Added a unit test to make sure that the Expires and Date 
headers have consisent formatting and contain GMT
 new bacf851c40 Checkstyle and comment

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../authenticator/TestFormAuthenticatorA.java  | 37 ++
 1 file changed, 37 insertions(+)


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 02/02: Checkstyle and comment

2024-09-27 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit bacf851c40f7ac00a154defe6a784bdb2e34e371
Author: remm 
AuthorDate: Fri Sep 27 10:23:34 2024 +0200

Checkstyle and comment
---
 test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java 
b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
index 2b24015b63..c748711c0f 100644
--- a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
+++ b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
@@ -40,11 +40,11 @@ import org.apache.catalina.startup.TesterMapRealm;
 import org.apache.catalina.startup.TesterServlet;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.tomcat.util.buf.ByteChunk;
 import org.apache.tomcat.util.descriptor.web.LoginConfig;
 import org.apache.tomcat.util.descriptor.web.SecurityCollection;
 import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
 import org.apache.tomcat.websocket.server.WsContextListener;
-import org.apache.tomcat.util.buf.ByteChunk;
 
 /*
  * Test FORM authentication for sessions that do and do not use cookies.
@@ -222,7 +222,7 @@ public class TestFormAuthenticatorA extends TomcatBaseTest {
 
 
 /*
- * Test to ensure that the Expir and 
+ * Test to ensure that the expire and date headers use a GMT date.
  */
 @Test
 public void testDateAndExpireHeadersUseGMT() throws Exception {
@@ -235,7 +235,7 @@ public class TestFormAuthenticatorA extends TomcatBaseTest {
 ctxt.getPipeline().addValve(form);
 tomcat.start();
 
-Map> responseHeaders = new HashMap();
+Map> responseHeaders = new HashMap<>();
 ByteChunk bc = new ByteChunk();
 String path = "http://localhost:"; + getPort() + 
"/examples/jsp/security/protected/index.jsp";
 int rc = getUrl(path, bc, responseHeaders);


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 01/02: Added a unit test to make sure that the Expires and Date headers have consisent formatting and contain GMT

2024-09-27 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit b55299df3ab780d1cb8638a675f9655128d98e20
Author: Paul Lodge 
AuthorDate: Tue Sep 17 16:39:58 2024 +0200

Added a unit test to make sure that the Expires and Date headers have 
consisent formatting and contain GMT
---
 .../authenticator/TestFormAuthenticatorA.java  | 37 ++
 1 file changed, 37 insertions(+)

diff --git a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java 
b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
index 2671b3e1cb..2b24015b63 100644
--- a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
+++ b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
@@ -18,8 +18,12 @@ package org.apache.catalina.authenticator;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.StringTokenizer;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import jakarta.servlet.ServletException;
 import jakarta.servlet.http.HttpServlet;
@@ -40,6 +44,7 @@ import org.apache.tomcat.util.descriptor.web.LoginConfig;
 import org.apache.tomcat.util.descriptor.web.SecurityCollection;
 import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
 import org.apache.tomcat.websocket.server.WsContextListener;
+import org.apache.tomcat.util.buf.ByteChunk;
 
 /*
  * Test FORM authentication for sessions that do and do not use cookies.
@@ -216,6 +221,38 @@ public class TestFormAuthenticatorA extends TomcatBaseTest 
{
 }
 
 
+/*
+ * Test to ensure that the Expir and 
+ */
+@Test
+public void testDateAndExpireHeadersUseGMT() throws Exception {
+Tomcat tomcat = getTomcatInstance();
+
+File appDir = new File(getBuildDirectory(), "webapps/examples");
+Context ctxt  = tomcat.addWebapp(null, "/examples", 
appDir.getAbsolutePath());
+FormAuthenticator form = new FormAuthenticator();
+form.setSecurePagesWithPragma(true);
+ctxt.getPipeline().addValve(form);
+tomcat.start();
+
+Map> responseHeaders = new HashMap();
+ByteChunk bc = new ByteChunk();
+String path = "http://localhost:"; + getPort() + 
"/examples/jsp/security/protected/index.jsp";
+int rc = getUrl(path, bc, responseHeaders);
+Assert.assertTrue(String.format("Expecting 200, but got ", rc), rc == 
200);
+String expiresDate = responseHeaders.get("Expires").get(0).toString();
+
+String ExpectedDateFormatRegx = "^[A-za-z]{3}, \\d{2} \\w{3} \\d{4} 
\\d{2}:\\d{2}:\\d{2} GMT$";
+Pattern pattern = Pattern.compile(ExpectedDateFormatRegx);
+Matcher matcher = pattern.matcher((CharSequence)expiresDate);
+Assert.assertTrue("Expires header date not in expected format", 
matcher.matches());
+
+String Date = responseHeaders.get("Date").get(0).toString();
+matcher = pattern.matcher((CharSequence)Date);
+Assert.assertTrue("Date header not in expected format", 
matcher.matches());
+}
+
+
 /*
  * Choreograph the steps of the test dialogue with the server
  *  1. while not authenticated, try to access a protected resource


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 10.1.x updated (9b439fcc72 -> 7dd25ff718)

2024-09-27 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a change to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


from 9b439fcc72 Always use code blocks
 new b55299df3a Added a unit test to make sure that the Expires and Date 
headers have consisent formatting and contain GMT
 new 7dd25ff718 Checkstyle and comment

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../authenticator/TestFormAuthenticatorA.java  | 37 ++
 1 file changed, 37 insertions(+)


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 02/02: Checkstyle and comment

2024-09-27 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 7dd25ff71835dae52f3363de58215e5fdf8c45e7
Author: remm 
AuthorDate: Fri Sep 27 10:23:34 2024 +0200

Checkstyle and comment
---
 test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java 
b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
index 2b24015b63..c748711c0f 100644
--- a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
+++ b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
@@ -40,11 +40,11 @@ import org.apache.catalina.startup.TesterMapRealm;
 import org.apache.catalina.startup.TesterServlet;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.tomcat.util.buf.ByteChunk;
 import org.apache.tomcat.util.descriptor.web.LoginConfig;
 import org.apache.tomcat.util.descriptor.web.SecurityCollection;
 import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
 import org.apache.tomcat.websocket.server.WsContextListener;
-import org.apache.tomcat.util.buf.ByteChunk;
 
 /*
  * Test FORM authentication for sessions that do and do not use cookies.
@@ -222,7 +222,7 @@ public class TestFormAuthenticatorA extends TomcatBaseTest {
 
 
 /*
- * Test to ensure that the Expir and 
+ * Test to ensure that the expire and date headers use a GMT date.
  */
 @Test
 public void testDateAndExpireHeadersUseGMT() throws Exception {
@@ -235,7 +235,7 @@ public class TestFormAuthenticatorA extends TomcatBaseTest {
 ctxt.getPipeline().addValve(form);
 tomcat.start();
 
-Map> responseHeaders = new HashMap();
+Map> responseHeaders = new HashMap<>();
 ByteChunk bc = new ByteChunk();
 String path = "http://localhost:"; + getPort() + 
"/examples/jsp/security/protected/index.jsp";
 int rc = getUrl(path, bc, responseHeaders);


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 9.0.x updated (c9293e2ab4 -> 273caa8c71)

2024-09-27 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a change to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


from c9293e2ab4 Always use code blocks
 new e45d8fb100 Added a unit test to make sure that the Expires and Date 
headers have consisent formatting and contain GMT
 new 273caa8c71 Checkstyle and comment

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../authenticator/TestFormAuthenticatorA.java  | 37 ++
 1 file changed, 37 insertions(+)


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 01/02: Added a unit test to make sure that the Expires and Date headers have consisent formatting and contain GMT

2024-09-27 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit e45d8fb1004439bf3c4dfceba1f56e18c1309085
Author: Paul Lodge 
AuthorDate: Tue Sep 17 16:39:58 2024 +0200

Added a unit test to make sure that the Expires and Date headers have 
consisent formatting and contain GMT
---
 .../authenticator/TestFormAuthenticatorA.java  | 37 ++
 1 file changed, 37 insertions(+)

diff --git a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java 
b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
index baf3bed5c9..9ab563c000 100644
--- a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
+++ b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
@@ -18,8 +18,12 @@ package org.apache.catalina.authenticator;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.StringTokenizer;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
@@ -40,6 +44,7 @@ import org.apache.tomcat.util.descriptor.web.LoginConfig;
 import org.apache.tomcat.util.descriptor.web.SecurityCollection;
 import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
 import org.apache.tomcat.websocket.server.WsContextListener;
+import org.apache.tomcat.util.buf.ByteChunk;
 
 /*
  * Test FORM authentication for sessions that do and do not use cookies.
@@ -216,6 +221,38 @@ public class TestFormAuthenticatorA extends TomcatBaseTest 
{
 }
 
 
+/*
+ * Test to ensure that the Expir and 
+ */
+@Test
+public void testDateAndExpireHeadersUseGMT() throws Exception {
+Tomcat tomcat = getTomcatInstance();
+
+File appDir = new File(getBuildDirectory(), "webapps/examples");
+Context ctxt  = tomcat.addWebapp(null, "/examples", 
appDir.getAbsolutePath());
+FormAuthenticator form = new FormAuthenticator();
+form.setSecurePagesWithPragma(true);
+ctxt.getPipeline().addValve(form);
+tomcat.start();
+
+Map> responseHeaders = new HashMap();
+ByteChunk bc = new ByteChunk();
+String path = "http://localhost:"; + getPort() + 
"/examples/jsp/security/protected/index.jsp";
+int rc = getUrl(path, bc, responseHeaders);
+Assert.assertTrue(String.format("Expecting 200, but got ", rc), rc == 
200);
+String expiresDate = responseHeaders.get("Expires").get(0).toString();
+
+String ExpectedDateFormatRegx = "^[A-za-z]{3}, \\d{2} \\w{3} \\d{4} 
\\d{2}:\\d{2}:\\d{2} GMT$";
+Pattern pattern = Pattern.compile(ExpectedDateFormatRegx);
+Matcher matcher = pattern.matcher((CharSequence)expiresDate);
+Assert.assertTrue("Expires header date not in expected format", 
matcher.matches());
+
+String Date = responseHeaders.get("Date").get(0).toString();
+matcher = pattern.matcher((CharSequence)Date);
+Assert.assertTrue("Date header not in expected format", 
matcher.matches());
+}
+
+
 /*
  * Choreograph the steps of the test dialogue with the server
  *  1. while not authenticated, try to access a protected resource


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 02/02: Checkstyle and comment

2024-09-27 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 273caa8c71bc9cf862fb413aef5d8481800df1b1
Author: remm 
AuthorDate: Fri Sep 27 10:23:34 2024 +0200

Checkstyle and comment
---
 test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java 
b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
index 9ab563c000..91b1da1a3c 100644
--- a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
+++ b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
@@ -40,11 +40,11 @@ import org.apache.catalina.startup.TesterMapRealm;
 import org.apache.catalina.startup.TesterServlet;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.tomcat.util.buf.ByteChunk;
 import org.apache.tomcat.util.descriptor.web.LoginConfig;
 import org.apache.tomcat.util.descriptor.web.SecurityCollection;
 import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
 import org.apache.tomcat.websocket.server.WsContextListener;
-import org.apache.tomcat.util.buf.ByteChunk;
 
 /*
  * Test FORM authentication for sessions that do and do not use cookies.
@@ -222,7 +222,7 @@ public class TestFormAuthenticatorA extends TomcatBaseTest {
 
 
 /*
- * Test to ensure that the Expir and 
+ * Test to ensure that the expire and date headers use a GMT date.
  */
 @Test
 public void testDateAndExpireHeadersUseGMT() throws Exception {
@@ -235,7 +235,7 @@ public class TestFormAuthenticatorA extends TomcatBaseTest {
 ctxt.getPipeline().addValve(form);
 tomcat.start();
 
-Map> responseHeaders = new HashMap();
+Map> responseHeaders = new HashMap<>();
 ByteChunk bc = new ByteChunk();
 String path = "http://localhost:"; + getPort() + 
"/examples/jsp/security/protected/index.jsp";
 int rc = getUrl(path, bc, responseHeaders);


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Buildbot success in on tomcat-10.1.x

2024-09-27 Thread buildbot
Build status: Build succeeded!
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/44/builds/1416
Blamelist: Mark Thomas , Paul Lodge , remm 

Build Text: build successful
Status Detected: restored build
Build Source Stamp: [branch 10.1.x] 7dd25ff71835dae52f3363de58215e5fdf8c45e7


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 1

  shell_6: 0

  shell_7: 0

  shell_8: 0

  shell_9: 0

  Rsync docs to nightlies.apache.org: 0

  shell_10: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 1

  shell_11: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 10.1.x updated: Fix IDE warnings

2024-09-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
 new ad1162bcd2 Fix IDE warnings
ad1162bcd2 is described below

commit ad1162bcd23bbc173c20ce0fbf4ec7a750efb9f0
Author: Mark Thomas 
AuthorDate: Fri Sep 27 11:21:48 2024 +0100

Fix IDE warnings
---
 test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java 
b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
index c748711c0f..00b63783aa 100644
--- a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
+++ b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
@@ -239,16 +239,16 @@ public class TestFormAuthenticatorA extends 
TomcatBaseTest {
 ByteChunk bc = new ByteChunk();
 String path = "http://localhost:"; + getPort() + 
"/examples/jsp/security/protected/index.jsp";
 int rc = getUrl(path, bc, responseHeaders);
-Assert.assertTrue(String.format("Expecting 200, but got ", rc), rc == 
200);
+Assert.assertTrue(String.format("Expecting 200, but got ", 
Integer.valueOf(rc)), rc == 200);
 String expiresDate = responseHeaders.get("Expires").get(0).toString();
 
 String ExpectedDateFormatRegx = "^[A-za-z]{3}, \\d{2} \\w{3} \\d{4} 
\\d{2}:\\d{2}:\\d{2} GMT$";
 Pattern pattern = Pattern.compile(ExpectedDateFormatRegx);
-Matcher matcher = pattern.matcher((CharSequence)expiresDate);
+Matcher matcher = pattern.matcher(expiresDate);
 Assert.assertTrue("Expires header date not in expected format", 
matcher.matches());
 
 String Date = responseHeaders.get("Date").get(0).toString();
-matcher = pattern.matcher((CharSequence)Date);
+matcher = pattern.matcher(Date);
 Assert.assertTrue("Date header not in expected format", 
matcher.matches());
 }
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch main updated: Fix IDE warnings

2024-09-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
 new 2276ee88f2 Fix IDE warnings
2276ee88f2 is described below

commit 2276ee88f27b25934eda354e6479d5beb39f158d
Author: Mark Thomas 
AuthorDate: Fri Sep 27 11:21:48 2024 +0100

Fix IDE warnings
---
 test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java 
b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
index c748711c0f..00b63783aa 100644
--- a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
+++ b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
@@ -239,16 +239,16 @@ public class TestFormAuthenticatorA extends 
TomcatBaseTest {
 ByteChunk bc = new ByteChunk();
 String path = "http://localhost:"; + getPort() + 
"/examples/jsp/security/protected/index.jsp";
 int rc = getUrl(path, bc, responseHeaders);
-Assert.assertTrue(String.format("Expecting 200, but got ", rc), rc == 
200);
+Assert.assertTrue(String.format("Expecting 200, but got ", 
Integer.valueOf(rc)), rc == 200);
 String expiresDate = responseHeaders.get("Expires").get(0).toString();
 
 String ExpectedDateFormatRegx = "^[A-za-z]{3}, \\d{2} \\w{3} \\d{4} 
\\d{2}:\\d{2}:\\d{2} GMT$";
 Pattern pattern = Pattern.compile(ExpectedDateFormatRegx);
-Matcher matcher = pattern.matcher((CharSequence)expiresDate);
+Matcher matcher = pattern.matcher(expiresDate);
 Assert.assertTrue("Expires header date not in expected format", 
matcher.matches());
 
 String Date = responseHeaders.get("Date").get(0).toString();
-matcher = pattern.matcher((CharSequence)Date);
+matcher = pattern.matcher(Date);
 Assert.assertTrue("Date header not in expected format", 
matcher.matches());
 }
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 11.0.x updated: Fix IDE warnings

2024-09-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/11.0.x by this push:
 new 3c83e17392 Fix IDE warnings
3c83e17392 is described below

commit 3c83e17392355ee66032f0713f9f9eeaca758ede
Author: Mark Thomas 
AuthorDate: Fri Sep 27 11:21:48 2024 +0100

Fix IDE warnings
---
 test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java 
b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
index c748711c0f..00b63783aa 100644
--- a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
+++ b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
@@ -239,16 +239,16 @@ public class TestFormAuthenticatorA extends 
TomcatBaseTest {
 ByteChunk bc = new ByteChunk();
 String path = "http://localhost:"; + getPort() + 
"/examples/jsp/security/protected/index.jsp";
 int rc = getUrl(path, bc, responseHeaders);
-Assert.assertTrue(String.format("Expecting 200, but got ", rc), rc == 
200);
+Assert.assertTrue(String.format("Expecting 200, but got ", 
Integer.valueOf(rc)), rc == 200);
 String expiresDate = responseHeaders.get("Expires").get(0).toString();
 
 String ExpectedDateFormatRegx = "^[A-za-z]{3}, \\d{2} \\w{3} \\d{4} 
\\d{2}:\\d{2}:\\d{2} GMT$";
 Pattern pattern = Pattern.compile(ExpectedDateFormatRegx);
-Matcher matcher = pattern.matcher((CharSequence)expiresDate);
+Matcher matcher = pattern.matcher(expiresDate);
 Assert.assertTrue("Expires header date not in expected format", 
matcher.matches());
 
 String Date = responseHeaders.get("Date").get(0).toString();
-matcher = pattern.matcher((CharSequence)Date);
+matcher = pattern.matcher(Date);
 Assert.assertTrue("Date header not in expected format", 
matcher.matches());
 }
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 9.0.x updated: Fix IDE warnings

2024-09-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 372f3cefe6 Fix IDE warnings
372f3cefe6 is described below

commit 372f3cefe6225b58fcdae7c344d81396b8e08570
Author: Mark Thomas 
AuthorDate: Fri Sep 27 11:21:48 2024 +0100

Fix IDE warnings
---
 test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java 
b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
index 91b1da1a3c..fb89945a87 100644
--- a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
+++ b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
@@ -239,16 +239,16 @@ public class TestFormAuthenticatorA extends 
TomcatBaseTest {
 ByteChunk bc = new ByteChunk();
 String path = "http://localhost:"; + getPort() + 
"/examples/jsp/security/protected/index.jsp";
 int rc = getUrl(path, bc, responseHeaders);
-Assert.assertTrue(String.format("Expecting 200, but got ", rc), rc == 
200);
+Assert.assertTrue(String.format("Expecting 200, but got ", 
Integer.valueOf(rc)), rc == 200);
 String expiresDate = responseHeaders.get("Expires").get(0).toString();
 
 String ExpectedDateFormatRegx = "^[A-za-z]{3}, \\d{2} \\w{3} \\d{4} 
\\d{2}:\\d{2}:\\d{2} GMT$";
 Pattern pattern = Pattern.compile(ExpectedDateFormatRegx);
-Matcher matcher = pattern.matcher((CharSequence)expiresDate);
+Matcher matcher = pattern.matcher(expiresDate);
 Assert.assertTrue("Expires header date not in expected format", 
matcher.matches());
 
 String Date = responseHeaders.get("Date").get(0).toString();
-matcher = pattern.matcher((CharSequence)Date);
+matcher = pattern.matcher(Date);
 Assert.assertTrue("Date header not in expected format", 
matcher.matches());
 }
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 69338] Overhead in El processing (AST*)

2024-09-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69338

Mark Thomas  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #6 from Mark Thomas  ---
Fixed in:
- 11.0.x for 11.0.0 onwards
- 10.1.x for 10.1.31 onwards
-  9.0.x for  9.0.96 onwards

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Buildbot success in on tomcat-11.0.x

2024-09-27 Thread buildbot
Build status: Build succeeded!
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/112/builds/1300
Blamelist: Mark Thomas , Paul Lodge , remm 

Build Text: build successful
Status Detected: restored build
Build Source Stamp: [branch 11.0.x] 3c83e17392355ee66032f0713f9f9eeaca758ede


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  shell_6: 0

  compile: 1

  shell_7: 0

  shell_8: 0

  shell_9: 0

  shell_10: 0

  Rsync docs to nightlies.apache.org: 0

  shell_11: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 1

  shell_12: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Buildbot success in on tomcat-9.0.x

2024-09-27 Thread buildbot
Build status: Build succeeded!
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/37/builds/1098
Blamelist: Mark Thomas , Paul Lodge , remm 

Build Text: build successful
Status Detected: restored build
Build Source Stamp: [branch 9.0.x] ffc0a2696ab0f33f14501174bf5f644e7aa06e3b


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 1

  shell_6: 0

  shell_7: 0

  shell_8: 0

  shell_9: 0

  Rsync docs to nightlies.apache.org: 0

  shell_10: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 1

  shell_11: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 69338] Overhead in El processing (AST*)

2024-09-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69338

--- Comment #7 from John Engebretson  ---
Thank you for the quick turnaround!  FWIW, the report I received is holding up,
but there's also some internal code in the area.  I'll open a new ticket for
anything else I stumble upon.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 11.0.x updated: Review and fix edge cases after CI failure.

2024-09-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/11.0.x by this push:
 new 002d38647f Review and fix edge cases after CI failure.
002d38647f is described below

commit 002d38647fc1c2491907cfeeeb8197fd343ab48b
Author: Mark Thomas 
AuthorDate: Fri Sep 27 11:05:51 2024 +0100

Review and fix edge cases after CI failure.
---
 .../apache/tomcat/util/http/TestFastHttpDateFormat.java| 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java 
b/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java
index e50a60cc9f..20e771ef1e 100644
--- a/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java
+++ b/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java
@@ -38,16 +38,18 @@ public class TestFastHttpDateFormat {
 String d1 = FastHttpDateFormat.getCurrentDate();
 long start = System.currentTimeMillis() / 1000;
 
-long t1 = 0;
+long t1 = start;
 long t2 = 0;
-long t3 = start;
+long t3 = 0;
 String d2 = d1;
 
 /*
- * Run this test for 3s. Should normally see 3 changes of date. 
May, very rarely, see 2.
+ * Run this test for 3s. Should normally see 3 changes of date. 
Because d1 and t1 are not set atomically,
+ * it is possible for them to be inconsistent. That inconsistency 
can lead to one more or one less change
+ * than typically expected. Therefore, the test accepts 2, 3 or 4 
changes.
  */
 int changes = 0;
-while (t3 - start < 3) {
+while (t1 - start < 3) {
 
 // Copy results to next slot, dropping the oldest (t3 and d2)
 d2 = d1;
@@ -63,11 +65,11 @@ public class TestFastHttpDateFormat {
 changes++;
 // Then the second must have changed
 if (t1 == t2 && t2 == t3) {
-Assert.fail("Formatted date changed withint the same 
second");
+Assert.fail("Formatted date changed within the same 
second");
 }
 }
 }
-Assert.assertTrue("Saw [" + changes + "] in formatted date", 
changes > 1 && changes < 4);
+Assert.assertTrue("Saw [" + changes + "] changes in formatted 
date", changes > 1 && changes < 5);
 }
 }
 }


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch main updated: Review and fix edge cases after CI failure.

2024-09-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
 new 0d6b794df6 Review and fix edge cases after CI failure.
0d6b794df6 is described below

commit 0d6b794df679921b240f334d9061ca2dc7e4ef8d
Author: Mark Thomas 
AuthorDate: Fri Sep 27 11:05:51 2024 +0100

Review and fix edge cases after CI failure.
---
 .../apache/tomcat/util/http/TestFastHttpDateFormat.java| 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java 
b/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java
index e50a60cc9f..20e771ef1e 100644
--- a/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java
+++ b/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java
@@ -38,16 +38,18 @@ public class TestFastHttpDateFormat {
 String d1 = FastHttpDateFormat.getCurrentDate();
 long start = System.currentTimeMillis() / 1000;
 
-long t1 = 0;
+long t1 = start;
 long t2 = 0;
-long t3 = start;
+long t3 = 0;
 String d2 = d1;
 
 /*
- * Run this test for 3s. Should normally see 3 changes of date. 
May, very rarely, see 2.
+ * Run this test for 3s. Should normally see 3 changes of date. 
Because d1 and t1 are not set atomically,
+ * it is possible for them to be inconsistent. That inconsistency 
can lead to one more or one less change
+ * than typically expected. Therefore, the test accepts 2, 3 or 4 
changes.
  */
 int changes = 0;
-while (t3 - start < 3) {
+while (t1 - start < 3) {
 
 // Copy results to next slot, dropping the oldest (t3 and d2)
 d2 = d1;
@@ -63,11 +65,11 @@ public class TestFastHttpDateFormat {
 changes++;
 // Then the second must have changed
 if (t1 == t2 && t2 == t3) {
-Assert.fail("Formatted date changed withint the same 
second");
+Assert.fail("Formatted date changed within the same 
second");
 }
 }
 }
-Assert.assertTrue("Saw [" + changes + "] in formatted date", 
changes > 1 && changes < 4);
+Assert.assertTrue("Saw [" + changes + "] changes in formatted 
date", changes > 1 && changes < 5);
 }
 }
 }


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 10.1.x updated: Review and fix edge cases after CI failure.

2024-09-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 962c479ed1 Review and fix edge cases after CI failure.
962c479ed1 is described below

commit 962c479ed15e65a826a5e59147cfd6c2bc4a6e3c
Author: Mark Thomas 
AuthorDate: Fri Sep 27 11:05:51 2024 +0100

Review and fix edge cases after CI failure.
---
 .../apache/tomcat/util/http/TestFastHttpDateFormat.java| 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java 
b/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java
index e50a60cc9f..20e771ef1e 100644
--- a/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java
+++ b/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java
@@ -38,16 +38,18 @@ public class TestFastHttpDateFormat {
 String d1 = FastHttpDateFormat.getCurrentDate();
 long start = System.currentTimeMillis() / 1000;
 
-long t1 = 0;
+long t1 = start;
 long t2 = 0;
-long t3 = start;
+long t3 = 0;
 String d2 = d1;
 
 /*
- * Run this test for 3s. Should normally see 3 changes of date. 
May, very rarely, see 2.
+ * Run this test for 3s. Should normally see 3 changes of date. 
Because d1 and t1 are not set atomically,
+ * it is possible for them to be inconsistent. That inconsistency 
can lead to one more or one less change
+ * than typically expected. Therefore, the test accepts 2, 3 or 4 
changes.
  */
 int changes = 0;
-while (t3 - start < 3) {
+while (t1 - start < 3) {
 
 // Copy results to next slot, dropping the oldest (t3 and d2)
 d2 = d1;
@@ -63,11 +65,11 @@ public class TestFastHttpDateFormat {
 changes++;
 // Then the second must have changed
 if (t1 == t2 && t2 == t3) {
-Assert.fail("Formatted date changed withint the same 
second");
+Assert.fail("Formatted date changed within the same 
second");
 }
 }
 }
-Assert.assertTrue("Saw [" + changes + "] in formatted date", 
changes > 1 && changes < 4);
+Assert.assertTrue("Saw [" + changes + "] changes in formatted 
date", changes > 1 && changes < 5);
 }
 }
 }


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 9.0.x updated: Review and fix edge cases after CI failure.

2024-09-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 5e4f5aa216 Review and fix edge cases after CI failure.
5e4f5aa216 is described below

commit 5e4f5aa2167f20452c1d11ae0540b96cb3a70c4f
Author: Mark Thomas 
AuthorDate: Fri Sep 27 11:05:51 2024 +0100

Review and fix edge cases after CI failure.
---
 .../apache/tomcat/util/http/TestFastHttpDateFormat.java| 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java 
b/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java
index e50a60cc9f..20e771ef1e 100644
--- a/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java
+++ b/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java
@@ -38,16 +38,18 @@ public class TestFastHttpDateFormat {
 String d1 = FastHttpDateFormat.getCurrentDate();
 long start = System.currentTimeMillis() / 1000;
 
-long t1 = 0;
+long t1 = start;
 long t2 = 0;
-long t3 = start;
+long t3 = 0;
 String d2 = d1;
 
 /*
- * Run this test for 3s. Should normally see 3 changes of date. 
May, very rarely, see 2.
+ * Run this test for 3s. Should normally see 3 changes of date. 
Because d1 and t1 are not set atomically,
+ * it is possible for them to be inconsistent. That inconsistency 
can lead to one more or one less change
+ * than typically expected. Therefore, the test accepts 2, 3 or 4 
changes.
  */
 int changes = 0;
-while (t3 - start < 3) {
+while (t1 - start < 3) {
 
 // Copy results to next slot, dropping the oldest (t3 and d2)
 d2 = d1;
@@ -63,11 +65,11 @@ public class TestFastHttpDateFormat {
 changes++;
 // Then the second must have changed
 if (t1 == t2 && t2 == t3) {
-Assert.fail("Formatted date changed withint the same 
second");
+Assert.fail("Formatted date changed within the same 
second");
 }
 }
 }
-Assert.assertTrue("Saw [" + changes + "] in formatted date", 
changes > 1 && changes < 4);
+Assert.assertTrue("Saw [" + changes + "] changes in formatted 
date", changes > 1 && changes < 5);
 }
 }
 }


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 69348] Optimizable memory allocation in ELContext

2024-09-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69348

--- Comment #1 from John Engebretson  ---
Prod data confirms the allocation of many ArrayDeque.  Margin of error is high
so I won't quote numbers, but it's definitely present.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 01/01: Merge pull request #756 from PaulLodge/expire-header-uses-gmt

2024-09-27 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 2b582321baa0e05ecf6f2be5a8377a385a22e938
Merge: 472173a8e7 4f2baf0d54
Author: Rémy Maucherat 
AuthorDate: Fri Sep 27 10:19:58 2024 +0200

Merge pull request #756 from PaulLodge/expire-header-uses-gmt

Unit test ensuring that the Expires and Date headers use GMT

 .../authenticator/TestFormAuthenticatorA.java  | 37 ++
 1 file changed, 37 insertions(+)


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [PR] Unit test ensuring that the Expires and Date headers use GMT [tomcat]

2024-09-27 Thread via GitHub


rmaucher merged PR #756:
URL: https://github.com/apache/tomcat/pull/756


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch main updated (472173a8e7 -> 2b582321ba)

2024-09-27 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


from 472173a8e7 Always use code blocks
 add 4f2baf0d54 Added a unit test to make sure that the Expires and Date 
headers have consisent formatting and contain GMT
 new 2b582321ba Merge pull request #756 from 
PaulLodge/expire-header-uses-gmt

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../authenticator/TestFormAuthenticatorA.java  | 37 ++
 1 file changed, 37 insertions(+)


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 9.0.x updated: API changes

2024-09-27 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new ffc0a2696a API changes
ffc0a2696a is described below

commit ffc0a2696ab0f33f14501174bf5f644e7aa06e3b
Author: remm 
AuthorDate: Fri Sep 27 10:39:20 2024 +0200

API changes
---
 test/org/apache/el/parser/TestAstEmpty.java| 6 +++---
 test/org/apache/el/parser/TestAstNotEmpty.java | 6 +++---
 test/org/apache/el/parser/TestELParserPerformance.java | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/test/org/apache/el/parser/TestAstEmpty.java 
b/test/org/apache/el/parser/TestAstEmpty.java
index 1523967189..dd38899754 100644
--- a/test/org/apache/el/parser/TestAstEmpty.java
+++ b/test/org/apache/el/parser/TestAstEmpty.java
@@ -16,7 +16,7 @@
  */
 package org.apache.el.parser;
 
-import jakarta.el.ELProcessor;
+import javax.el.ELProcessor;
 
 import org.junit.Assert;
 import org.junit.Test;
@@ -26,7 +26,7 @@ public class TestAstEmpty {
 @Test
 public void test01() {
 ELProcessor processor = new ELProcessor();
-Boolean result = processor.eval("empty 'abc'");
+Object result = processor.eval("empty 'abc'");
 Assert.assertEquals(Boolean.FALSE, result);
 }
 
@@ -34,7 +34,7 @@ public class TestAstEmpty {
 @Test
 public void test02() {
 ELProcessor processor = new ELProcessor();
-Boolean result = processor.eval("empty ''");
+Object result = processor.eval("empty ''");
 Assert.assertEquals(Boolean.TRUE, result);
 }
 }
diff --git a/test/org/apache/el/parser/TestAstNotEmpty.java 
b/test/org/apache/el/parser/TestAstNotEmpty.java
index dceca6bb1c..ab6ce3944b 100644
--- a/test/org/apache/el/parser/TestAstNotEmpty.java
+++ b/test/org/apache/el/parser/TestAstNotEmpty.java
@@ -16,7 +16,7 @@
  */
 package org.apache.el.parser;
 
-import jakarta.el.ELProcessor;
+import javax.el.ELProcessor;
 
 import org.junit.Assert;
 import org.junit.Test;
@@ -26,7 +26,7 @@ public class TestAstNotEmpty {
 @Test
 public void test01() {
 ELProcessor processor = new ELProcessor();
-Boolean result = processor.eval("not empty 'abc'");
+Object result = processor.eval("not empty 'abc'");
 Assert.assertEquals(Boolean.TRUE, result);
 }
 
@@ -34,7 +34,7 @@ public class TestAstNotEmpty {
 @Test
 public void test02() {
 ELProcessor processor = new ELProcessor();
-Boolean result = processor.eval("not empty ''");
+Object result = processor.eval("not empty ''");
 Assert.assertEquals(Boolean.FALSE, result);
 }
 }
diff --git a/test/org/apache/el/parser/TestELParserPerformance.java 
b/test/org/apache/el/parser/TestELParserPerformance.java
index f92f311041..c02bad3a78 100644
--- a/test/org/apache/el/parser/TestELParserPerformance.java
+++ b/test/org/apache/el/parser/TestELParserPerformance.java
@@ -163,7 +163,7 @@ public class TestELParserPerformance {
 
 for (int i = 0; i < 1000; i++) {
 ValueExpression ve = factory.createValueExpression(context, 
expression, Boolean.class);
-Boolean result = ve.getValue(context);
+Object result = ve.getValue(context);
 Assert.assertEquals(Boolean.TRUE, result);
 }
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 69347] New: https://www.ninjacart.com/

2024-09-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69347

Bug ID: 69347
   Summary: https://www.ninjacart.com/
   Product: Tomcat Native
   Version: 2.0.8
  Hardware: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: Documentation
  Assignee: dev@tomcat.apache.org
  Reporter: reachus...@ninjacart.com
  Target Milestone: ---

Created attachment 39878
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=39878&action=edit
https://www.ninjacart.com/

https://www.ninjacart.com/

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 69347] SPAM SPAM SPAM SPAM

2024-09-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69347

Chuck Caldarale  changed:

   What|Removed |Added

Summary|https://www.ninjacart.com/  |SPAM SPAM SPAM SPAM
 OS||All
 Status|NEW |RESOLVED
 Resolution|--- |INVALID

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 69347] SPAM SPAM SPAM SPAM

2024-09-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69347

Chuck Caldarale  changed:

   What|Removed |Added

  Attachment #39878|https://www.ninjacart.com/  |SPAM SPAM SPAM SPAM
description||

--- Comment #1 from Chuck Caldarale  ---
Comment on attachment 39878
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=39878
SPAM SPAM SPAM SPAM

SPAM SPAM SPAM SPAM

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 69347] SPAM SPAM SPAM SPAM

2024-09-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69347

--- Comment #2 from Chuck Caldarale  ---
The content of attachment 39878 has been deleted for the following reason:

Spam

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org