(tomcat) branch 10.1.x updated: Correctly calculate h2 request statistics now requests are reused

2025-06-18 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 ec32fee38b Correctly calculate h2 request statistics now requests are 
reused
ec32fee38b is described below

commit ec32fee38b4924391aec0c5af3f7c44e71a26ed0
Author: Mark Thomas 
AuthorDate: Wed Jun 18 08:48:46 2025 +0100

Correctly calculate h2 request statistics now requests are reused
---
 java/org/apache/coyote/RequestInfo.java   | 14 ++
 java/org/apache/coyote/http2/StreamProcessor.java | 14 +-
 webapps/docs/changelog.xml|  5 +
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/RequestInfo.java 
b/java/org/apache/coyote/RequestInfo.java
index 41081f5806..0dc534da74 100644
--- a/java/org/apache/coyote/RequestInfo.java
+++ b/java/org/apache/coyote/RequestInfo.java
@@ -261,4 +261,18 @@ public class RequestInfo {
 public void setLastRequestProcessingTime(long lastRequestProcessingTime) {
 this.lastRequestProcessingTime = lastRequestProcessingTime;
 }
+
+public void recycleStatistcs() {
+this.bytesSent = 0;
+this.bytesReceived = 0;
+
+this.processingTime = 0;
+this.maxTime = 0;
+this.maxRequestUri = null;
+
+this.requestCount = 0;
+this.errorCount = 0;
+
+this.lastRequestProcessingTime = 0;
+}
 }
diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index 55b913e63a..b8fb78469d 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -147,8 +147,14 @@ class StreamProcessor extends AbstractProcessor implements 
NonPipeliningProcesso
 state = SocketState.CLOSED;
 } finally {
 if (state == SocketState.CLOSED) {
-stream.recycle();
+/*
+ * Recycle this processor before the stream is 
recycled as recycling the stream will add the
+ * request and the response to the pool for re-use (if 
re-use is enabled) and the request
+ * statistics updating in StreamProcessor.recycle() 
needs to happen before the request and
+ * response are added to the pool to avoid concurrency 
issues corrupting the statistics.
+ */
 recycle();
+stream.recycle();
 }
 }
 } finally {
@@ -433,6 +439,12 @@ class StreamProcessor extends AbstractProcessor implements 
NonPipeliningProcesso
 global.removeRequestProcessor(request.getRequestProcessor());
 }
 
+/*
+ * Clear the statistics ready for re-use of the request. If we don't 
clear the statistics, the statistics for
+ * the current request will be included in the statistics for all 
future requests.
+ */
+request.getRequestProcessor().recycleStatistcs();
+
 // Clear fields that can be cleared to aid GC and trigger NPEs if this
 // is reused
 setSocketWrapper(null);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index a3214cd2e4..35a24f4775 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -124,6 +124,11 @@
 69713: Correctly handle an HTTP/2 data frame that includes
 padding when the headers include a content-length. (remm/markt)
   
+  
+Correctly collect statistics for HTTP/2 requests and avoid counting one
+request multiple times. Based on pull request 868 by
+qingdaoheze. (markt)
+  
 
   
   


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



(tomcat) branch main updated: Correctly calculate h2 request statistics now requests are reused

2025-06-18 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 4dc1a0f94b Correctly calculate h2 request statistics now requests are 
reused
4dc1a0f94b is described below

commit 4dc1a0f94bf17221a24a5f349771b9b36fd6d34d
Author: Mark Thomas 
AuthorDate: Wed Jun 18 08:48:46 2025 +0100

Correctly calculate h2 request statistics now requests are reused
---
 java/org/apache/coyote/RequestInfo.java   | 14 ++
 java/org/apache/coyote/http2/StreamProcessor.java | 14 +-
 webapps/docs/changelog.xml|  5 +
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/RequestInfo.java 
b/java/org/apache/coyote/RequestInfo.java
index 41081f5806..0dc534da74 100644
--- a/java/org/apache/coyote/RequestInfo.java
+++ b/java/org/apache/coyote/RequestInfo.java
@@ -261,4 +261,18 @@ public class RequestInfo {
 public void setLastRequestProcessingTime(long lastRequestProcessingTime) {
 this.lastRequestProcessingTime = lastRequestProcessingTime;
 }
+
+public void recycleStatistcs() {
+this.bytesSent = 0;
+this.bytesReceived = 0;
+
+this.processingTime = 0;
+this.maxTime = 0;
+this.maxRequestUri = null;
+
+this.requestCount = 0;
+this.errorCount = 0;
+
+this.lastRequestProcessingTime = 0;
+}
 }
diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index 2b7ea79701..edd9c74a9b 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -147,8 +147,14 @@ class StreamProcessor extends AbstractProcessor implements 
NonPipeliningProcesso
 state = SocketState.CLOSED;
 } finally {
 if (state == SocketState.CLOSED) {
-stream.recycle();
+/*
+ * Recycle this processor before the stream is 
recycled as recycling the stream will add the
+ * request and the response to the pool for re-use (if 
re-use is enabled) and the request
+ * statistics updating in StreamProcessor.recycle() 
needs to happen before the request and
+ * response are added to the pool to avoid concurrency 
issues corrupting the statistics.
+ */
 recycle();
+stream.recycle();
 }
 }
 } finally {
@@ -416,6 +422,12 @@ class StreamProcessor extends AbstractProcessor implements 
NonPipeliningProcesso
 global.removeRequestProcessor(request.getRequestProcessor());
 }
 
+/*
+ * Clear the statistics ready for re-use of the request. If we don't 
clear the statistics, the statistics for
+ * the current request will be included in the statistics for all 
future requests.
+ */
+request.getRequestProcessor().recycleStatistcs();
+
 // Clear fields that can be cleared to aid GC and trigger NPEs if this
 // is reused
 setSocketWrapper(null);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index d1a10217cc..cadf1f7adb 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -197,6 +197,11 @@
 69713: Correctly handle an HTTP/2 data frame that includes
 padding when the headers include a content-length. (remm/markt)
   
+  
+Correctly collect statistics for HTTP/2 requests and avoid counting one
+request multiple times. Based on pull request 868 by
+qingdaoheze. (markt)
+  
 
   
   


-
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: Correctly calculate h2 request statistics now requests are reused

2025-06-18 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 7f252d0c5a Correctly calculate h2 request statistics now requests are 
reused
7f252d0c5a is described below

commit 7f252d0c5a938d726f8eb757370c3f9c54937a54
Author: Mark Thomas 
AuthorDate: Wed Jun 18 08:48:46 2025 +0100

Correctly calculate h2 request statistics now requests are reused
---
 java/org/apache/coyote/RequestInfo.java   | 14 ++
 java/org/apache/coyote/http2/StreamProcessor.java | 14 +-
 webapps/docs/changelog.xml|  5 +
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/RequestInfo.java 
b/java/org/apache/coyote/RequestInfo.java
index 41081f5806..0dc534da74 100644
--- a/java/org/apache/coyote/RequestInfo.java
+++ b/java/org/apache/coyote/RequestInfo.java
@@ -261,4 +261,18 @@ public class RequestInfo {
 public void setLastRequestProcessingTime(long lastRequestProcessingTime) {
 this.lastRequestProcessingTime = lastRequestProcessingTime;
 }
+
+public void recycleStatistcs() {
+this.bytesSent = 0;
+this.bytesReceived = 0;
+
+this.processingTime = 0;
+this.maxTime = 0;
+this.maxRequestUri = null;
+
+this.requestCount = 0;
+this.errorCount = 0;
+
+this.lastRequestProcessingTime = 0;
+}
 }
diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index 2b7ea79701..edd9c74a9b 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -147,8 +147,14 @@ class StreamProcessor extends AbstractProcessor implements 
NonPipeliningProcesso
 state = SocketState.CLOSED;
 } finally {
 if (state == SocketState.CLOSED) {
-stream.recycle();
+/*
+ * Recycle this processor before the stream is 
recycled as recycling the stream will add the
+ * request and the response to the pool for re-use (if 
re-use is enabled) and the request
+ * statistics updating in StreamProcessor.recycle() 
needs to happen before the request and
+ * response are added to the pool to avoid concurrency 
issues corrupting the statistics.
+ */
 recycle();
+stream.recycle();
 }
 }
 } finally {
@@ -416,6 +422,12 @@ class StreamProcessor extends AbstractProcessor implements 
NonPipeliningProcesso
 global.removeRequestProcessor(request.getRequestProcessor());
 }
 
+/*
+ * Clear the statistics ready for re-use of the request. If we don't 
clear the statistics, the statistics for
+ * the current request will be included in the statistics for all 
future requests.
+ */
+request.getRequestProcessor().recycleStatistcs();
+
 // Clear fields that can be cleared to aid GC and trigger NPEs if this
 // is reused
 setSocketWrapper(null);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 161bc34e16..4b77434bdb 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -128,6 +128,11 @@
 69713: Correctly handle an HTTP/2 data frame that includes
 padding when the headers include a content-length. (remm/markt)
   
+  
+Correctly collect statistics for HTTP/2 requests and avoid counting one
+request multiple times. Based on pull request 868 by
+qingdaoheze. (markt)
+  
 
   
   


-
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: Correctly calculate h2 request statistics now requests are reused

2025-06-18 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 94a55974bb Correctly calculate h2 request statistics now requests are 
reused
94a55974bb is described below

commit 94a55974bb556d9f703b697487128af9a7cf1fa3
Author: Mark Thomas 
AuthorDate: Wed Jun 18 08:48:46 2025 +0100

Correctly calculate h2 request statistics now requests are reused
---
 java/org/apache/coyote/RequestInfo.java   | 14 ++
 java/org/apache/coyote/http2/StreamProcessor.java | 14 +-
 webapps/docs/changelog.xml|  5 +
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/RequestInfo.java 
b/java/org/apache/coyote/RequestInfo.java
index 3bea07319e..dae6918ce7 100644
--- a/java/org/apache/coyote/RequestInfo.java
+++ b/java/org/apache/coyote/RequestInfo.java
@@ -261,4 +261,18 @@ public class RequestInfo {
 public void setLastRequestProcessingTime(long lastRequestProcessingTime) {
 this.lastRequestProcessingTime = lastRequestProcessingTime;
 }
+
+public void recycleStatistcs() {
+this.bytesSent = 0;
+this.bytesReceived = 0;
+
+this.processingTime = 0;
+this.maxTime = 0;
+this.maxRequestUri = null;
+
+this.requestCount = 0;
+this.errorCount = 0;
+
+this.lastRequestProcessingTime = 0;
+}
 }
diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index ab8b716b19..7256140138 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -147,8 +147,14 @@ class StreamProcessor extends AbstractProcessor implements 
NonPipeliningProcesso
 state = SocketState.CLOSED;
 } finally {
 if (state == SocketState.CLOSED) {
-stream.recycle();
+/*
+ * Recycle this processor before the stream is 
recycled as recycling the stream will add the
+ * request and the response to the pool for re-use (if 
re-use is enabled) and the request
+ * statistics updating in StreamProcessor.recycle() 
needs to happen before the request and
+ * response are added to the pool to avoid concurrency 
issues corrupting the statistics.
+ */
 recycle();
+stream.recycle();
 }
 }
 } finally {
@@ -439,6 +445,12 @@ class StreamProcessor extends AbstractProcessor implements 
NonPipeliningProcesso
 global.removeRequestProcessor(request.getRequestProcessor());
 }
 
+/*
+ * Clear the statistics ready for re-use of the request. If we don't 
clear the statistics, the statistics for
+ * the current request will be included in the statistics for all 
future requests.
+ */
+request.getRequestProcessor().recycleStatistcs();
+
 // Clear fields that can be cleared to aid GC and trigger NPEs if this
 // is reused
 setSocketWrapper(null);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 2f6c4c7c18..48aa794c47 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -124,6 +124,11 @@
 69713: Correctly handle an HTTP/2 data frame that includes
 padding when the headers include a content-length. (remm/markt)
   
+  
+Correctly collect statistics for HTTP/2 requests and avoid counting one
+request multiple times. Based on pull request 868 by
+qingdaoheze. (markt)
+  
 
   
   


-
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: Use Reader instead of explicit StringReader

2025-06-18 Thread schultz
This is an automated email from the ASF dual-hosted git repository.

schultz 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 9616b3e03c Use Reader instead of explicit StringReader
9616b3e03c is described below

commit 9616b3e03cfb93785da4f109d6264ed2f9f70df0
Author: Christopher Schultz 
AuthorDate: Wed Jun 18 11:35:10 2025 -0400

Use Reader instead of explicit StringReader

Avoid double-assignment
---
 java/org/apache/tomcat/util/http/parser/MediaType.java | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/tomcat/util/http/parser/MediaType.java 
b/java/org/apache/tomcat/util/http/parser/MediaType.java
index ff2a5f76d8..fc37f30761 100644
--- a/java/org/apache/tomcat/util/http/parser/MediaType.java
+++ b/java/org/apache/tomcat/util/http/parser/MediaType.java
@@ -17,7 +17,7 @@
 package org.apache.tomcat.util.http.parser;
 
 import java.io.IOException;
-import java.io.StringReader;
+import java.io.Reader;
 import java.util.LinkedHashMap;
 import java.util.Locale;
 import java.util.Map;
@@ -124,7 +124,7 @@ public class MediaType {
  *
  * @throws IOException if there was a problem reading the input
  */
-public static MediaType parseMediaType(StringReader input) throws 
IOException {
+public static MediaType parseMediaType(Reader input) throws IOException {
 
 // Type (required)
 String type = HttpParser.readToken(input);
@@ -151,9 +151,11 @@ public class MediaType {
 while (lookForSemiColon == SkipResult.FOUND) {
 String attribute = HttpParser.readToken(input);
 
-String value = "";
+String value;
 if (HttpParser.skipConstant(input, "=") == SkipResult.FOUND) {
 value = HttpParser.readTokenOrQuotedString(input, true);
+} else {
+value = "";
 }
 
 if (attribute != null) {


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



[Bug 69717] DirResourceSet breaks with trailing slash on webAppMount

2025-06-18 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69717

--- Comment #1 from Remy Maucherat  ---
Please read: "Moderate: Security constraint bypass for PreResources and
PostResources CVE-2025-49125" https://tomcat.apache.org/security-9.html

Stripping the trailing / in AbstractResourceSet.setWebAppMount seems possible.

-- 
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-9.0.x

2025-06-18 Thread buildbot
Build status: Build succeeded!
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/37/builds/1433
Blamelist: Mark Thomas 
Build Text: build successful
Status Detected: restored build
Build Source Stamp: [branch 9.0.x] 94a55974bb556d9f703b697487128af9a7cf1fa3


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



(tomcat) branch main updated: Use Reader instead of explicit StringReader

2025-06-18 Thread schultz
This is an automated email from the ASF dual-hosted git repository.

schultz 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 0801c8c3f7 Use Reader instead of explicit StringReader
0801c8c3f7 is described below

commit 0801c8c3f797f3db7af630cb59b678908832e45d
Author: Christopher Schultz 
AuthorDate: Wed Jun 18 11:35:10 2025 -0400

Use Reader instead of explicit StringReader

Avoid double-assignment
---
 java/org/apache/tomcat/util/http/parser/MediaType.java | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/tomcat/util/http/parser/MediaType.java 
b/java/org/apache/tomcat/util/http/parser/MediaType.java
index ff2a5f76d8..fc37f30761 100644
--- a/java/org/apache/tomcat/util/http/parser/MediaType.java
+++ b/java/org/apache/tomcat/util/http/parser/MediaType.java
@@ -17,7 +17,7 @@
 package org.apache.tomcat.util.http.parser;
 
 import java.io.IOException;
-import java.io.StringReader;
+import java.io.Reader;
 import java.util.LinkedHashMap;
 import java.util.Locale;
 import java.util.Map;
@@ -124,7 +124,7 @@ public class MediaType {
  *
  * @throws IOException if there was a problem reading the input
  */
-public static MediaType parseMediaType(StringReader input) throws 
IOException {
+public static MediaType parseMediaType(Reader input) throws IOException {
 
 // Type (required)
 String type = HttpParser.readToken(input);
@@ -151,9 +151,11 @@ public class MediaType {
 while (lookForSemiColon == SkipResult.FOUND) {
 String attribute = HttpParser.readToken(input);
 
-String value = "";
+String value;
 if (HttpParser.skipConstant(input, "=") == SkipResult.FOUND) {
 value = HttpParser.readTokenOrQuotedString(input, true);
+} else {
+value = "";
 }
 
 if (attribute != null) {


-
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: Use Reader instead of explicit StringReader

2025-06-18 Thread schultz
This is an automated email from the ASF dual-hosted git repository.

schultz 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 6225882e85 Use Reader instead of explicit StringReader
6225882e85 is described below

commit 6225882e852dec53ba3c3e8ddad5c01cbeef924e
Author: Christopher Schultz 
AuthorDate: Wed Jun 18 11:35:10 2025 -0400

Use Reader instead of explicit StringReader

Avoid double-assignment
---
 java/org/apache/tomcat/util/http/parser/MediaType.java | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/tomcat/util/http/parser/MediaType.java 
b/java/org/apache/tomcat/util/http/parser/MediaType.java
index ff2a5f76d8..fc37f30761 100644
--- a/java/org/apache/tomcat/util/http/parser/MediaType.java
+++ b/java/org/apache/tomcat/util/http/parser/MediaType.java
@@ -17,7 +17,7 @@
 package org.apache.tomcat.util.http.parser;
 
 import java.io.IOException;
-import java.io.StringReader;
+import java.io.Reader;
 import java.util.LinkedHashMap;
 import java.util.Locale;
 import java.util.Map;
@@ -124,7 +124,7 @@ public class MediaType {
  *
  * @throws IOException if there was a problem reading the input
  */
-public static MediaType parseMediaType(StringReader input) throws 
IOException {
+public static MediaType parseMediaType(Reader input) throws IOException {
 
 // Type (required)
 String type = HttpParser.readToken(input);
@@ -151,9 +151,11 @@ public class MediaType {
 while (lookForSemiColon == SkipResult.FOUND) {
 String attribute = HttpParser.readToken(input);
 
-String value = "";
+String value;
 if (HttpParser.skipConstant(input, "=") == SkipResult.FOUND) {
 value = HttpParser.readTokenOrQuotedString(input, true);
+} else {
+value = "";
 }
 
 if (attribute != null) {


-
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: Use Reader instead of explicit StringReader

2025-06-18 Thread schultz
This is an automated email from the ASF dual-hosted git repository.

schultz 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 51ed9c22a1 Use Reader instead of explicit StringReader
51ed9c22a1 is described below

commit 51ed9c22a1944d4bcfc0aaf3df4a69b023e0f544
Author: Christopher Schultz 
AuthorDate: Wed Jun 18 11:35:10 2025 -0400

Use Reader instead of explicit StringReader

Avoid double-assignment
---
 java/org/apache/tomcat/util/http/parser/MediaType.java | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/tomcat/util/http/parser/MediaType.java 
b/java/org/apache/tomcat/util/http/parser/MediaType.java
index ff2a5f76d8..fc37f30761 100644
--- a/java/org/apache/tomcat/util/http/parser/MediaType.java
+++ b/java/org/apache/tomcat/util/http/parser/MediaType.java
@@ -17,7 +17,7 @@
 package org.apache.tomcat.util.http.parser;
 
 import java.io.IOException;
-import java.io.StringReader;
+import java.io.Reader;
 import java.util.LinkedHashMap;
 import java.util.Locale;
 import java.util.Map;
@@ -124,7 +124,7 @@ public class MediaType {
  *
  * @throws IOException if there was a problem reading the input
  */
-public static MediaType parseMediaType(StringReader input) throws 
IOException {
+public static MediaType parseMediaType(Reader input) throws IOException {
 
 // Type (required)
 String type = HttpParser.readToken(input);
@@ -151,9 +151,11 @@ public class MediaType {
 while (lookForSemiColon == SkipResult.FOUND) {
 String attribute = HttpParser.readToken(input);
 
-String value = "";
+String value;
 if (HttpParser.skipConstant(input, "=") == SkipResult.FOUND) {
 value = HttpParser.readTokenOrQuotedString(input, true);
+} else {
+value = "";
 }
 
 if (attribute != null) {


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



[Bug 69717] DirResourceSet breaks with trailing slash on webAppMount

2025-06-18 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69717

--- Comment #2 from Jonas Verhofsté  ---
Or config validation should fail when the param has a trailing slash?

It just silently not working and that not being documented anywhere is still a
regression caused by the fix for the CVE. :)

-- 
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