http-client-branch: Fixed chunked encoding in DigestEchoServer http-client-branch
authordfuchs
Thu, 15 Feb 2018 20:09:01 +0000
branchhttp-client-branch
changeset 56136 3b58e5bacad6
parent 56135 e359a2716711
child 56137 dd867826d55b
http-client-branch: Fixed chunked encoding in DigestEchoServer
test/jdk/java/net/httpclient/DigestEchoServer.java
--- a/test/jdk/java/net/httpclient/DigestEchoServer.java	Thu Feb 15 19:11:34 2018 +0000
+++ b/test/jdk/java/net/httpclient/DigestEchoServer.java	Thu Feb 15 20:09:01 2018 +0000
@@ -627,7 +627,7 @@
 
     protected void writeResponse(HttpTestExchange he) throws IOException {
         if (delegate == null) {
-            he.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0);
+            he.sendResponseHeaders(HttpURLConnection.HTTP_OK, -1);
             he.getResponseBody().write(he.getRequestBody().readAllBytes());
         } else {
             delegate.handle(he);
@@ -745,7 +745,7 @@
                 if (!isAuthentified(he)) {
                     try {
                         requestAuthentication(he);
-                        he.sendResponseHeaders(getUnauthorizedCode(), 0);
+                        he.sendResponseHeaders(getUnauthorizedCode(), -1);
                         System.out.println(type
                             + ": Sent back " + getUnauthorizedCode());
                     } finally {
@@ -1238,7 +1238,7 @@
                                     ? "proxy" : "server"));
             he.getResponseHeaders().addHeader(getLocation(),
                 redirectTargetURL.toExternalForm().toString());
-            he.sendResponseHeaders(get3XX(), 0);
+            he.sendResponseHeaders(get3XX(), -1);
             System.out.println(type + ": Sent back " + get3XX() + " "
                  + getLocation() + ": " + redirectTargetURL.toExternalForm().toString());
         }