Ignore:
Timestamp:
07/15/14 13:45:31 (10 years ago)
Author:
pharms
Message:
  • bugfix and test for correct query handling
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-httpmonitor/src/main/java/de/ugoe/cs/autoquest/httpmonitor/proxy/HttpMonitoringProxyServlet.java

    r1567 r1614  
    1919import java.net.URI; 
    2020import java.net.URISyntaxException; 
     21import java.net.URLDecoder; 
    2122import java.net.URLEncoder; 
    2223import java.nio.ByteBuffer; 
     
    99100    protected URI rewriteURI(HttpServletRequest request) { 
    100101        try { 
     102            String query = request.getQueryString(); 
     103             
     104            if (query != null) { 
     105                query = URLDecoder.decode(query, "UTF-8"); 
     106            } 
     107             
    101108            return new URI(request.getScheme(), null, proxiedServer, proxiedPort, 
    102                            request.getPathInfo(), request.getQueryString(), null); 
     109                           request.getPathInfo(), query, null); 
    103110        } 
    104111        catch (URISyntaxException e) { 
     112            Console.printerrln("could not rewrite URI: " + e); 
     113            Console.logException(e); 
     114            return null; 
     115        } 
     116        catch (UnsupportedEncodingException e) { 
    105117            Console.printerrln("could not rewrite URI: " + e); 
    106118            Console.logException(e); 
     
    365377                } 
    366378            } 
    367             return result.toString(); 
     379             
     380            if (result.length() <= 0) { 
     381                return null; 
     382            } 
     383            else { 
     384                return result.toString(); 
     385            } 
    368386        } 
    369387 
Note: See TracChangeset for help on using the changeset viewer.