ASF Bugzilla – Attachment 19164 Details for
Bug 41008
POST request ignores command line parameters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to include POST query method when determining if the query string should be converted to CGI command line params
CGIServlet-queryparams-fix.diff (text/plain), 2.17 KB, created by
Chris Halstead
on 2006-11-22 22:10:00 UTC
(
hide
)
Description:
Patch to include POST query method when determining if the query string should be converted to CGI command line params
Filename:
MIME Type:
Creator:
Chris Halstead
Created:
2006-11-22 22:10:00 UTC
Size:
2.17 KB
patch
obsolete
>Index: CGIServlet.java >=================================================================== >--- CGIServlet.java (revision 478279) >+++ CGIServlet.java (working copy) >@@ -807,30 +807,22 @@ > this.pathInfo = this.servletPath; > } > >- // If request is HEAD or GET and Query String does not contain >- // an unencoded "=" this is an indexed query. Parsed Query String >- // forms command line parameters for cgi command. >- if (!"GET".equals(req.getMethod()) && >- !"HEAD".equals(req.getMethod())) >- return; >- >- String qs = req.getQueryString(); >- >- if (qs == null || qs.indexOf("=")>0) >- return; >- >- int delimIndex = 0; >- int lastDelimIndex = 0; >- delimIndex = qs.indexOf("+"); >- >- while (delimIndex >0) { >- cmdLineParameters.add(URLDecoder.decode(qs.substring( >- lastDelimIndex,delimIndex),parameterEncoding)); >- lastDelimIndex = delimIndex + 1; >- delimIndex = qs.indexOf("+",lastDelimIndex); >+ // If the request method is GET, POST or HEAD and the query string >+ // does not contain an unencoded "=" this is an indexed query. >+ // The parsed query string becomes the command line parameters >+ // for the cgi command. >+ if (req.getMethod().equals("GET") >+ || req.getMethod().equals("POST") >+ || req.getMethod().equals("HEAD")) { >+ String qs = req.getQueryString(); >+ if (qs != null && qs.indexOf("=") == -1) { >+ StringTokenizer qsTokens = new StringTokenizer(qs, "+"); >+ while ( qsTokens.hasMoreTokens() ) { >+ cmdLineParameters.add(URLDecoder.decode(qsTokens.nextToken(), >+ parameterEncoding)); >+ } >+ } > } >- cmdLineParameters.add(URLDecoder.decode(qs.substring( >- lastDelimIndex),parameterEncoding)); > } > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 41008
: 19164