You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by mg...@apache.org on 2020/02/20 11:25:34 UTC

[tomcat] branch 9.0.x updated: Revert "Check for non-null 'methods'"

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

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


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

commit eb2ab3cd33e23b786685bb40f6c50e78f46c379b
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Thu Feb 20 13:25:21 2020 +0200

    Revert "Check for non-null 'methods'"
    
    This reverts commit f85638784471b80da82fc4ef89b3424698da981b.
---
 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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org