This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new e3c9ac812d Remove unnecessary code
e3c9ac812d is described below
commit e3c9ac812d1c083f751231ac77fe09a2f419efaf
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 f3edd1745f..6190b628fc 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -2308,14 +2308,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]