This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 873b25b0c24b71a04b22439487e401b74decb309 Author: Mark Thomas <ma...@apache.org> AuthorDate: Mon Jul 1 16:15:47 2019 +0100 Remove unnecessary test --- java/org/apache/catalina/servlets/DefaultServlet.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java b/java/org/apache/catalina/servlets/DefaultServlet.java index 5ddfcb8..5d3cc79 100644 --- a/java/org/apache/catalina/servlets/DefaultServlet.java +++ b/java/org/apache/catalina/servlets/DefaultServlet.java @@ -1454,17 +1454,9 @@ public class DefaultServlet extends HttpServlet { HttpServletResponse response, WebResource resource) throws IOException { - if (!"GET".equals(request.getMethod())) { - // RFC 7233#3.1 clarifies the intention of RFC 2616 was to only - // allow Range headers on GET requests. However, many people - // incorrectly read RFC 2616#14.35.1 as allowing partial PUT and - // implemented. Tomcat was one such implementation. It is optionally - // allowed to retain compatibility with clients that use it. - if (!allowPartialPut || !"PUT".equals(request.getMethod())) { - return FULL; - } - } - + // Range headers are only valid on GET requests. That implies they are + // also valid on HEAD requests. This method is only called by doGet() + // and doHead() so no need to check the request method. // Checking If-Range String headerValue = request.getHeader("If-Range"); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org