diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/DumpHandler.java b/jetty-server/src/test/java/org/eclipse/jetty/server/DumpHandler.java index a6ee8cdac10..15ac0ce6e98 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/DumpHandler.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/DumpHandler.java @@ -15,6 +15,7 @@ package org.eclipse.jetty.server; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Reader; @@ -64,6 +65,13 @@ public class DumpHandler extends AbstractHandler if (!isStarted()) return; + if (request.getParameter("read")!=null) + { + Reader in = request.getReader(); + for (int i=Integer.parseInt(request.getParameter("read"));i-->0;) + in.read(); + } + if (request.getParameter("ISE")!=null) { throw new IllegalStateException(); @@ -183,23 +191,20 @@ public class DumpHandler extends AbstractHandler } writer.write("\n
"); + char[] content= new char[4096]; int len; try{ - request.setCharacterEncoding(StringUtil.__UTF8); Reader in=request.getReader(); - String charset=request.getCharacterEncoding(); - if (charset==null) - charset=StringUtil.__ISO_8859_1; while((len=in.read(content))>=0) writer.write(new String(content,0,len)); } catch(IOException e) - { - Log.warn(e); + { writer.write(e.toString()); } + writer.write(""); writer.write("