Skip to content

Commit

Permalink
selftests: fix java.io.IOException: HTTP/1.1 header parser received n…
Browse files Browse the repository at this point in the history
…o bytes (#153)
  • Loading branch information
jiridanek authored Jul 11, 2024
1 parent 1764396 commit b1d1d9e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ public void close() {
@Test
public void testMultipartFormData() throws Exception {
HttpServer httpd = HttpServer.create(new InetSocketAddress("localhost", 0), 0);
new Thread(() -> httpd.start()).start();
httpd.createContext("/", httpExchange -> {
httpExchange.sendResponseHeaders(200, 0);
httpExchange.getResponseBody().close();
});
httpd.start();
try {
MultipartFormDataBodyPublisher publisher = new MultipartFormDataBodyPublisher()
.add("key", "value")
Expand Down

0 comments on commit b1d1d9e

Please sign in to comment.