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

(-)CGIServlet.java (-23 / +15 lines)
Lines 807-836 Link Here
807
                this.pathInfo = this.servletPath;
807
                this.pathInfo = this.servletPath;
808
            }
808
            }
809
            
809
            
810
            // If request is HEAD or GET and Query String does not contain
810
            // If the request method is GET, POST or HEAD and the query string
811
            // an unencoded "=" this is an indexed query. Parsed Query String
811
            // does not contain an unencoded "=" this is an indexed query.
812
            // forms command line parameters for cgi command.
812
            // The parsed query string becomes the command line parameters
813
            if (!"GET".equals(req.getMethod()) &&
813
            // for the cgi command.
814
                    !"HEAD".equals(req.getMethod()))
814
            if (req.getMethod().equals("GET")
815
                return;
815
                || req.getMethod().equals("POST")
816
            
816
                || req.getMethod().equals("HEAD")) {
817
            String qs = req.getQueryString();
817
                String qs = req.getQueryString();
818
            
818
                if (qs != null && qs.indexOf("=") == -1) {
819
            if (qs == null || qs.indexOf("=")>0)
819
                    StringTokenizer qsTokens = new StringTokenizer(qs, "+");
820
                return;
820
                    while ( qsTokens.hasMoreTokens() ) {
821
            
821
                        cmdLineParameters.add(URLDecoder.decode(qsTokens.nextToken(),
822
            int delimIndex = 0;
822
                                              parameterEncoding));
823
            int lastDelimIndex = 0;
823
                    }
824
            delimIndex = qs.indexOf("+");
824
                }
825
            
826
            while (delimIndex >0) {
827
                cmdLineParameters.add(URLDecoder.decode(qs.substring(
828
                        lastDelimIndex,delimIndex),parameterEncoding));
829
                lastDelimIndex = delimIndex + 1;
830
                delimIndex = qs.indexOf("+",lastDelimIndex);
831
            }
825
            }
832
            cmdLineParameters.add(URLDecoder.decode(qs.substring(
833
                    lastDelimIndex),parameterEncoding));
834
        }
826
        }
835
827
836
828

Return to bug 41008