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

Content:

\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(""); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java index 685026b3e9c..a779b79a33a 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java @@ -233,7 +233,7 @@ public class HttpConnectionTest extends TestCase offset = checkContains(response,offset,"HTTP/1.1 200"); offset = checkContains(response,offset,"encoding=unknown"); offset = checkContains(response,offset,"/R1"); - offset = checkContains(response,offset,"12345"); + offset = checkContains(response,offset,"UnsupportedEncodingException"); } @@ -257,12 +257,16 @@ public class HttpConnectionTest extends TestCase int offset=0; offset=0; - requests="GET /R1?error=500 HTTP/1.1\n"+ + requests="GET /R1?read=1&error=500 HTTP/1.1\n"+ "Host: localhost\n"+ + "Transfer-Encoding: chunked\n"+ "Content-Type: text/plain; charset=utf-8\n"+ - "Content-Length: 10\n"+ - "\n"+ - "0123456789\n"+ + "\015\012"+ + "5;\015\012"+ + "12345\015\012"+ + "5;\015\012"+ + "67890\015\012"+ + "0;\015\012\015\012"+ "GET /R2 HTTP/1.1\n"+ "Host: localhost\n"+ "Content-Type: text/plain; charset=utf-8\n"+ @@ -287,12 +291,16 @@ public class HttpConnectionTest extends TestCase int offset=0; offset=0; - requests="GET /R1?ISE=true HTTP/1.1\n"+ + requests="GET /R1?read=1&ISE=true HTTP/1.1\n"+ "Host: localhost\n"+ + "Transfer-Encoding: chunked\n"+ "Content-Type: text/plain; charset=utf-8\n"+ - "Content-Length: 10\n"+ - "\n"+ - "0123456789\n"+ + "\015\012"+ + "5;\015\012"+ + "12345\015\012"+ + "5;\015\012"+ + "67890\015\012"+ + "0;\015\012\015\012"+ "GET /R2 HTTP/1.1\n"+ "Host: localhost\n"+ "Content-Type: text/plain; charset=utf-8\n"+