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
The following commit(s) were added to refs/heads/9.0.x by this push:
new 97e8c08f5c Review "Report a content length of Integer.MAX_VALUE as an
int"
97e8c08f5c is described below
commit 97e8c08f5cdea29253e4fe1e1ff36c5340f09530
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Oct 30 20:15:01 2026 +0000
Review "Report a content length of Integer.MAX_VALUE as an int"
Improve handling for content length above Integer.MAX_VALUE
---
java/org/apache/catalina/connector/Response.java | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/catalina/connector/Response.java
b/java/org/apache/catalina/connector/Response.java
index 461616f1a8..82312579e0 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -308,7 +308,7 @@ public class Response implements HttpServletResponse {
*/
public boolean isAppCommitted() {
return this.appCommitted || isCommitted() || isSuspended() ||
- ((getContentLength() > 0) && (getContentWritten() >=
getContentLength()));
+ ((getContentLengthLong() > 0) && (getContentWritten() >=
getContentLengthLong()));
}
@@ -479,6 +479,16 @@ public class Response implements HttpServletResponse {
}
+ /**
+ * Get the content length that was set or calculated for this response as
a long.
+ *
+ * @return the content length that was set or calculated for this response
+ */
+ public long getContentLengthLong() {
+ return getCoyoteResponse().getContentLengthLong();
+ }
+
+
@Override
public String getContentType() {
return getCoyoteResponse().getContentType();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]