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
 | 
			
		||||
	        String nextKey = (String)e.nextElement();
 | 
			
		||||
	        String[] paramValues = request.getParameterValues(nextKey);
 | 
			
		||||
	        String nextValue = paramValues[0];   // Only take first value
 | 
			
		||||
	        reqtrans.set (nextKey, nextValue);    // generic Header, Parameter
 | 
			
		||||
	        if (paramValues != null && paramValues.length == 1)
 | 
			
		||||
	            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();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -101,8 +101,10 @@ public class AcmeServletClient extends HttpServlet {
 | 
			
		|||
	        // Params parsen
 | 
			
		||||
	        String nextKey = (String)e.nextElement();
 | 
			
		||||
	        String[] paramValues = request.getParameterValues(nextKey);
 | 
			
		||||
	        String nextValue = paramValues[0];   // Only take first value
 | 
			
		||||
	        reqtrans.set (nextKey, nextValue);    // generic Header, Parameter
 | 
			
		||||
	        if (paramValues != null && paramValues.length == 1)
 | 
			
		||||
	            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();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue