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 e2646453d3 Remove unnecessary code
e2646453d3 is described below
commit e2646453d324bca94b2aa593d5bee35449641e05
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Dec 12 11:54:41 2024 +0000
Remove unnecessary code
---
java/org/apache/catalina/servlets/DefaultServlet.java | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java
b/java/org/apache/catalina/servlets/DefaultServlet.java
index 93297d3a5c..eb1bf46fa9 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -2367,14 +2367,13 @@ public class DefaultServlet extends HttpServlet {
}
try {
+ // Header is present so -1 will be not returned. Only a valid date
or an IAE are possible.
long headerValue = request.getDateHeader("If-Unmodified-Since");
- if (headerValue != -1) {
- if (resourceLastModified >= (headerValue + 1000)) {
- // The entity has not been modified since the date
- // specified by the client. This is not an error case.
-
response.sendError(HttpServletResponse.SC_PRECONDITION_FAILED);
- return false;
- }
+ if (resourceLastModified >= (headerValue + 1000)) {
+ // The entity has not been modified since the date
+ // specified by the client. This is not an error case.
+ response.sendError(HttpServletResponse.SC_PRECONDITION_FAILED);
+ return false;
}
} catch (IllegalArgumentException illegalArgument) {
return true;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]