View | Details | Raw Unified | Return to bug 61489
Collapse All | Expand All

(-)java/org/apache/catalina/servlets/CGIServlet.java (-3 / +11 lines)
Lines 282-287 Link Here
282
    /** the shell environment variables to be passed to the CGI script */
282
    /** the shell environment variables to be passed to the CGI script */
283
    private final Hashtable<String,String> shellEnv = new Hashtable<>();
283
    private final Hashtable<String,String> shellEnv = new Hashtable<>();
284
284
285
    /** enable creation of script command line arguments from query-string. 
286
     * See https://tools.ietf.org/html/rfc3875#section-4.4
287
     * 4.4.  The Script Command Line
288
     */
289
    private boolean enableCmdLineArguments = false;
290
    
285
    /**
291
    /**
286
     * Sets instance variables.
292
     * Sets instance variables.
287
     * <P>
293
     * <P>
Lines 341-346 Link Here
341
            envHttpHeadersPattern =
347
            envHttpHeadersPattern =
342
                    Pattern.compile(getServletConfig().getInitParameter("envHttpHeaders"));
348
                    Pattern.compile(getServletConfig().getInitParameter("envHttpHeaders"));
343
        }
349
        }
350
        
351
        enableCmdLineArguments =
352
        		    Boolean.parseBoolean(config.getInitParameter("enableCmdLineArguments"));
344
    }
353
    }
345
354
346
355
Lines 670-678 Link Here
670
            // does not contain an unencoded "=" this is an indexed query.
679
            // does not contain an unencoded "=" this is an indexed query.
671
            // The parsed query string becomes the command line parameters
680
            // The parsed query string becomes the command line parameters
672
            // for the cgi command.
681
            // for the cgi command.
673
            if (req.getMethod().equals("GET")
682
            if (enableCmdLineArguments && (req.getMethod().equals("GET")
674
                || req.getMethod().equals("POST")
683
                || req.getMethod().equals("POST") || req.getMethod().equals("HEAD"))) {
675
                || req.getMethod().equals("HEAD")) {
676
                String qs;
684
                String qs;
677
                if (isIncluded) {
685
                if (isIncluded) {
678
                    qs = (String) req.getAttribute(
686
                    qs = (String) req.getAttribute(

Return to bug 61489