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 c128b4744f Add debug logging for exceptions when parsing 
parameters/parts
c128b4744f is described below

commit c128b4744f973e8310b02098d4347a4d7b0ec97e
Author: remm <r...@apache.org>
AuthorDate: Tue Jun 24 14:50:49 2025 +0200

    Add debug logging for exceptions when parsing parameters/parts
    
    It is possible that frameworks swallow exceptions.
---
 java/org/apache/catalina/connector/LocalStrings.properties | 2 ++
 java/org/apache/catalina/connector/Request.java            | 8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/java/org/apache/catalina/connector/LocalStrings.properties 
b/java/org/apache/catalina/connector/LocalStrings.properties
index d20cd26bc4..d91ca15ce3 100644
--- a/java/org/apache/catalina/connector/LocalStrings.properties
+++ b/java/org/apache/catalina/connector/LocalStrings.properties
@@ -59,7 +59,9 @@ coyoteRequest.gssLifetimeFail=Failed to obtain remaining 
lifetime for user princ
 coyoteRequest.maxPostSizeExceeded=The multi-part request contained parameter 
data (excluding uploaded files) that exceeded the limit for maxPostSize set on 
the associated connector
 coyoteRequest.noAsync=Unable to start async because the following classes in 
the processing chain do not support async [{0}]
 coyoteRequest.noMultipartConfig=Unable to process parts as no multi-part 
configuration has been provided
+coyoteRequest.parametersParseException=Exception [{0}] occurred parsing 
parameters and will be thrown
 coyoteRequest.parseParameters=Exception thrown whilst processing POSTed 
parameters
+coyoteRequest.partsParseException=Exception [{0}] occurred parsing parts and 
will be thrown
 coyoteRequest.postTooLarge=Parameters were not parsed because the size of the 
posted data was too big. Use the maxPostSize attribute of the connector to 
resolve this if the application should accept large POSTs.
 coyoteRequest.sendfileNotCanonical=Unable to determine canonical name of file 
[{0}] specified for use with sendfile
 coyoteRequest.sessionCreateCommitted=Cannot create a session after the 
response has been committed
diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index 627e326932..ce06e6e10d 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -2333,6 +2333,10 @@ public class Request implements HttpServletRequest {
         parseParts(true);
 
         if (partsParseException != null) {
+            Context context = getContext();
+            if (context != null && context.getLogger().isDebugEnabled()) {
+                
context.getLogger().debug(sm.getString("coyoteRequest.partsParseException", 
partsParseException.getMessage()));
+            }
             switch (partsParseException) {
                 case IOException ioException -> throw ioException;
                 case IllegalStateException illegalStateException -> throw 
illegalStateException;
@@ -2707,6 +2711,10 @@ public class Request implements HttpServletRequest {
         doParseParameters();
 
         if (parametersParseException != null) {
+            Context context = getContext();
+            if (context != null && context.getLogger().isDebugEnabled()) {
+                
context.getLogger().debug(sm.getString("coyoteRequest.parametersParseException",
 parametersParseException.getMessage()));
+            }
             throw parametersParseException;
         }
     }


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

Reply via email to