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 f4e35c555a Clean-up and add change log entry
f4e35c555a is described below
commit f4e35c555a9d587b1989363cf5b380116f9a15da
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Nov 27 17:53:16 2024 +0000
Clean-up and add change log entry
---
java/org/apache/tomcat/util/http/parser/ContentRange.java | 8 +++++---
webapps/docs/changelog.xml | 5 +++++
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/java/org/apache/tomcat/util/http/parser/ContentRange.java
b/java/org/apache/tomcat/util/http/parser/ContentRange.java
index ba5df12d03..62a67c4221 100644
--- a/java/org/apache/tomcat/util/http/parser/ContentRange.java
+++ b/java/org/apache/tomcat/util/http/parser/ContentRange.java
@@ -40,6 +40,7 @@ public class ContentRange {
this.length = length;
}
+
/**
* @return rangeUnits in lower case.
*/
@@ -112,17 +113,18 @@ public class ContentRange {
}
ContentRange contentRange = new ContentRange(units, start, end,
length);
- if(!contentRange.isValid()) {
+ if (!contentRange.isValid()) {
// Invalid content range
return null;
}
return contentRange;
}
+
/**
- * @return <code>true</code> if the content range is valid, per rfc 9110
section 14.4
+ * @return <code>true</code> if the content range is valid, per RFC 9110
section 14.4
*/
public boolean isValid() {
- return start >= 0 && end >=start && length > end;
+ return start >= 0 && end >= start && length > end;
}
}
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index d4a0fe9e2a..9fba74b0fa 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -216,6 +216,11 @@
the requested ranges overlap. Based on pull request <pr>782</pr>
provided by Chenjp. (markt)
</fix>
+ <fix>
+ The default servlet now rejects partial PUT requests than contain
+ overlapping Content-Range values. Provided by Chenjp in pull request
+ <pr>778</pr>. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]