container.logger().warn("Invalid URI: " + uri + ". Attempting to parse query string.", e);
QueryStringDecoder decoder = new QueryStringDecoder(uri);
StringBuilder sb = new StringBuilder(decoder.path() + "?");
for (Map.Entry<String, List<String>> p : decoder.parameters().entrySet()) {
for (String value : p.getValue()) {
sb.append(p.getKey()).append("=").append(URLEncoder.encode(value, "UTF-8"));
}
}