This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 42a5701  Revert "Check for non-null 'methods'"
42a5701 is described below

commit 42a5701727cdcebb9e8e8346941d679bcda60eac
Author: Martin Tzvetanov Grigorov <mgrigo...@apache.org>
AuthorDate: Thu Feb 20 13:24:48 2020 +0200

    Revert "Check for non-null 'methods'"
    
    This reverts commit 84abf86f24142f1790b9cf5a31b8cce94822c8ce.
---
 java/javax/servlet/http/HttpServlet.java | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/java/javax/servlet/http/HttpServlet.java 
b/java/javax/servlet/http/HttpServlet.java
index 2ac26cf..aedbee6 100644
--- a/java/javax/servlet/http/HttpServlet.java
+++ b/java/javax/servlet/http/HttpServlet.java
@@ -502,21 +502,19 @@ public abstract class HttpServlet extends GenericServlet {
         }
         // End of Tomcat specific hack
 
-        if (methods != null) {
-            for (int i = 0; i < methods.length; i++) {
-                Method m = methods[i];
+        for (int i=0; i<methods.length; i++) {
+            Method m = methods[i];
 
-                if (m.getName().equals("doGet")) {
-                    ALLOW_GET = true;
-                    ALLOW_HEAD = true;
-                }
-                if (m.getName().equals("doPost"))
-                    ALLOW_POST = true;
-                if (m.getName().equals("doPut"))
-                    ALLOW_PUT = true;
-                if (m.getName().equals("doDelete"))
-                    ALLOW_DELETE = true;
+            if (m.getName().equals("doGet")) {
+                ALLOW_GET = true;
+                ALLOW_HEAD = true;
             }
+            if (m.getName().equals("doPost"))
+                ALLOW_POST = true;
+            if (m.getName().equals("doPut"))
+                ALLOW_PUT = true;
+            if (m.getName().equals("doDelete"))
+                ALLOW_DELETE = true;
         }
 
         String allow = null;


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to