HTTP parameters with multiple values are now translated to
an array instead of just setting the first value
This commit is contained in:
parent
c6d3edf6ae
commit
a0715302ae
2 changed files with 9 additions and 5 deletions
|
@ -129,8 +129,10 @@ public abstract class AbstractServletClient extends HttpServlet {
|
||||||
// Params parsen
|
// Params parsen
|
||||||
String nextKey = (String)e.nextElement();
|
String nextKey = (String)e.nextElement();
|
||||||
String[] paramValues = request.getParameterValues(nextKey);
|
String[] paramValues = request.getParameterValues(nextKey);
|
||||||
String nextValue = paramValues[0]; // Only take first value
|
if (paramValues != null && paramValues.length == 1)
|
||||||
reqtrans.set (nextKey, nextValue); // generic Header, Parameter
|
reqtrans.set (nextKey, paramValues[0]); // set to single string value
|
||||||
|
else if (paramValues != null)
|
||||||
|
reqtrans.set (nextKey, paramValues); // set to string array
|
||||||
}
|
}
|
||||||
|
|
||||||
String contentType = request.getContentType();
|
String contentType = request.getContentType();
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class AcmeServletClient extends HttpServlet {
|
||||||
|
|
||||||
public AcmeServletClient (Application app) {
|
public AcmeServletClient (Application app) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.uploadLimit = 1024; // generous 1mb upload limit
|
this.uploadLimit = 1024; // generous 1mb upload limit
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init (ServletConfig config) throws ServletException {
|
public void init (ServletConfig config) throws ServletException {
|
||||||
|
@ -101,8 +101,10 @@ public class AcmeServletClient extends HttpServlet {
|
||||||
// Params parsen
|
// Params parsen
|
||||||
String nextKey = (String)e.nextElement();
|
String nextKey = (String)e.nextElement();
|
||||||
String[] paramValues = request.getParameterValues(nextKey);
|
String[] paramValues = request.getParameterValues(nextKey);
|
||||||
String nextValue = paramValues[0]; // Only take first value
|
if (paramValues != null && paramValues.length == 1)
|
||||||
reqtrans.set (nextKey, nextValue); // generic Header, Parameter
|
reqtrans.set (nextKey, paramValues[0]); // set to single string value
|
||||||
|
else if (paramValues != null)
|
||||||
|
reqtrans.set (nextKey, paramValues); // set to string array
|
||||||
}
|
}
|
||||||
|
|
||||||
String contentType = request.getContentType();
|
String contentType = request.getContentType();
|
||||||
|
|
Loading…
Add table
Reference in a new issue