@@ -99,7 +99,7 @@ public void teardown() {
9999 if (testContentLengthServer != null )
100100 testContentLengthServer .stop (0 );
101101 }
102-
102+ /*
103103 @Test
104104 // A GET request with no request body should have no Content-length header
105105 public void getWithNoBody() throws IOException, InterruptedException {
@@ -151,20 +151,28 @@ public void deleteWithBody() throws IOException, InterruptedException {
151151 HttpResponse<String> resp = hc.send(req, HttpResponse.BodyHandlers.ofString(UTF_8));
152152 assertEquals(resp.statusCode(), 200, resp.body());
153153 }
154-
154+ */
155155 @ Test
156156 // A HEAD request with no request body should have no Content-length header
157157 public void headWithNoBody () throws IOException , InterruptedException {
158158 testLog .println ("Checking HEAD with no request body" );
159159 HttpRequest req = HttpRequest .newBuilder ()
160160 .version (HTTP_1_1 )
161161 .method ("HEAD" , HttpRequest .BodyPublishers .noBody ())
162+ //.method("HEAD", HttpRequest.BodyPublishers.ofString(null/""))
162163 .uri (URI .create (testContentLengthURI + NO_BODY_PATH ))
163164 .build ();
165+
166+ System .out .println ("GLGL: --" + HttpResponse .BodyHandlers .ofString (UTF_8 ) + "--" );
167+
164168 HttpResponse <String > resp = hc .send (req , HttpResponse .BodyHandlers .ofString (UTF_8 ));
165- assertEquals (resp .statusCode (), 200 , resp .body ());
166- }
167169
170+ System .out .println ("GLGL: " + resp .statusCode ());
171+ System .out .println ("GLGL: --" + resp .body () + "--" + resp .toString ());
172+
173+ assertEquals (resp .statusCode (), 400 , resp .body ());
174+ }
175+ /*
168176 @Test
169177 // A HEAD request with a request body should have a Content-length header
170178 public void headWithBody() throws IOException, InterruptedException {
@@ -179,7 +187,7 @@ public void headWithBody() throws IOException, InterruptedException {
179187 HttpResponse<String> resp = hc.send(req, HttpResponse.BodyHandlers.ofString(UTF_8));
180188 assertEquals(resp.statusCode(), 200, resp.body());
181189 }
182-
190+ */
183191 public static void handleResponse (HttpExchange ex , String body , int rCode ) throws IOException {
184192 try (InputStream is = ex .getRequestBody ();
185193 OutputStream os = ex .getResponseBody ()) {
0 commit comments