You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2023/01/10 10:19:42 UTC

[Bug 66415] New: Request.java HTTP Post too large error is overwritten with reason UNKNOWN

https://bz.apache.org/bugzilla/show_bug.cgi?id=66415

            Bug ID: 66415
           Summary: Request.java HTTP Post too large error is overwritten
                    with reason UNKNOWN
           Product: Tomcat 11
           Version: 11.0.0-M1
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: jangirmanish@live.in
  Target Milestone: -------

If an HTTP Request has large data i.e. more than maxPostSize, the code sets the
FailedReason.POST_TOO_LARGE. Since this code is in try block, the following
finally{} block sets the code to UNKNOWN if success is set to false.

int maxPostSize = connector.getMaxPostSize();
if ((maxPostSize >= 0) && (len > maxPostSize)) {
   Context context = getContext();
   if (context != null && context.getLogger().isDebugEnabled()) {
   context.getLogger().debug(
       sm.getString("coyoteRequest.postTooLarge"));
   }
   checkSwallowInput();
   parameters.setParseFailedReason(FailReason.POST_TOO_LARGE);
   return;
}

followed by a finally block
finally {
    if (!success) {
        parameters.setParseFailedReason(FailReason.UNKNOWN);
    }
}

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


[Bug 66415] Request.java HTTP Post too large error is overwritten with reason UNKNOWN

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66415

Remy Maucherat <re...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #1 from Remy Maucherat <re...@apache.org> ---
https://github.com/apache/tomcat/blob/main/java/org/apache/tomcat/util/http/Parameters.java#L121
The error is only set once, so UNKNOWN will not be set unless nothing was set
previously. Ok, maybe this kind of "trick" coding isn't always the best idea
but it should work here.

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