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:
parent
1b029b765f
commit
0c4642aa20
@ -59,7 +59,7 @@ public class HttpServerHandler {
|
|||||||
|
|
||||||
httpExchange.getResponseBody().write(byteResponse);
|
httpExchange.getResponseBody().write(byteResponse);
|
||||||
} else {
|
} else {
|
||||||
httpExchange.sendResponseHeaders(status, 0);
|
httpExchange.sendResponseHeaders(status, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
httpExchange.getResponseBody().close();
|
httpExchange.getResponseBody().close();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user