Fix length for empty response to prevent chunked stream

The java HttpExchange expects length -1 to send Content-length: 0 ...
This commit is contained in:
AsamK 2022-11-02 21:15:08 +01:00
parent 1b029b765f
commit 0c4642aa20

View file

@ -59,7 +59,7 @@ public class HttpServerHandler {
httpExchange.getResponseBody().write(byteResponse);
} else {
httpExchange.sendResponseHeaders(status, 0);
httpExchange.sendResponseHeaders(status, -1);
}
httpExchange.getResponseBody().close();