You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2026/04/24 18:34:35 UTC

(tomcat) branch 9.0.x updated (f09d4d3b4d -> 22693fcbe0)

This is an automated email from the ASF dual-hosted git repository.

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


    from f09d4d3b4d Remove unnecessary @SuppressWarnings
     new c234691141 Further improvements to CONNECT checks after CoPilot review
     new 22693fcbe0 Make test more robust

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:
 java/org/apache/coyote/http2/Stream.java             |  9 +++++++--
 .../catalina/valves/TestAccessLogValveFile.java      |  4 ++--
 .../apache/coyote/http2/TestHttp2Section_8_5.java    | 20 ++++++++++++++++++++
 3 files changed, 29 insertions(+), 4 deletions(-)


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


(tomcat) 02/02: Make test more robust

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 22693fcbe03af99e5ba1c3fff592a5665d973829
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Apr 24 18:46:58 2026 +0100

    Make test more robust
---
 test/org/apache/catalina/valves/TestAccessLogValveFile.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValveFile.java b/test/org/apache/catalina/valves/TestAccessLogValveFile.java
index 6dbafd63fe..394d548536 100644
--- a/test/org/apache/catalina/valves/TestAccessLogValveFile.java
+++ b/test/org/apache/catalina/valves/TestAccessLogValveFile.java
@@ -258,12 +258,12 @@ public class TestAccessLogValveFile extends TomcatBaseTest {
 
     @SuppressWarnings("BusyWait")
     private static void awaitFile(File file) throws InterruptedException {
-        long deadline = System.currentTimeMillis() + 2000;
+        long deadline = System.currentTimeMillis() + 5000;
         while (!file.exists() || file.length() == 0) {
             if (System.currentTimeMillis() > deadline) {
                 Assert.fail("Timed out waiting for " + file.getName());
             }
-            Thread.sleep(2);
+            Thread.sleep(50);
         }
     }
 }


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


(tomcat) 01/02: Further improvements to CONNECT checks after CoPilot review

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c234691141ccb147b96a7c444af241ab335b033e
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Apr 24 15:06:43 2026 +0100

    Further improvements to CONNECT checks after CoPilot review
---
 java/org/apache/coyote/http2/Stream.java             |  9 +++++++--
 .../apache/coyote/http2/TestHttp2Section_8_5.java    | 20 ++++++++++++++++++++
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/Stream.java b/java/org/apache/coyote/http2/Stream.java
index e79db4c27f..6b6c6152b3 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -596,11 +596,16 @@ class Stream extends AbstractNonZeroStream implements HeaderEmitter {
         if (coyoteRequest.getMethod() == null) {
             missingHeader = true;
         } else if (Method.CONNECT.equals(coyoteRequest.getMethod())) {
+            // CONNECT only
             if (!coyoteRequest.scheme().isNull() || !coyoteRequest.requestURI().isNull()) {
-                throw new StreamException(sm.getString("stream.header.invalidConnect",  getConnectionId(),
+                throw new StreamException(sm.getString("stream.header.invalidConnect", getConnectionId(),
                         getIdAsString()), Http2Error.PROTOCOL_ERROR, getIdAsInt());
             }
-        } else if (!Method.CONNECT.equals(coyoteRequest.getMethod())) {
+            if (coyoteRequest.serverName().isNull()) {
+                missingHeader = true;
+            }
+        } else {
+            // All other methods
             if (coyoteRequest.scheme().isNull() || coyoteRequest.requestURI().isNull()) {
                 missingHeader = true;
             }
diff --git a/test/org/apache/coyote/http2/TestHttp2Section_8_5.java b/test/org/apache/coyote/http2/TestHttp2Section_8_5.java
index f7bd35e474..52cd5de31f 100644
--- a/test/org/apache/coyote/http2/TestHttp2Section_8_5.java
+++ b/test/org/apache/coyote/http2/TestHttp2Section_8_5.java
@@ -61,4 +61,24 @@ public class TestHttp2Section_8_5 extends Http2TestBase {
 
         Assert.assertEquals("3-RST-[1]\n", output.getTrace());
     }
+
+
+    @Test
+    public void testConnectWithoutAuthority() throws Exception {
+        http2Connect();
+
+        byte[] frameHeader = new byte[9];
+        ByteBuffer headersPayload = ByteBuffer.allocate(128);
+
+        List<Header> headers = new ArrayList<>(4);
+        headers.add(new Header(":method", Method.CONNECT));
+
+        buildGetRequest(frameHeader, headersPayload, null, headers, 3);
+
+        writeFrame(frameHeader, headersPayload);
+
+        parser.readFrame();
+
+        Assert.assertEquals("3-RST-[1]\n", output.getTrace());
+    }
 }


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