Fix 200 OK given when response is not 200 OK

This commit is contained in:
Rsl1122 2017-07-29 23:52:54 +03:00
parent aacbdc2d53
commit 652c700d1a

View File

@ -94,7 +94,7 @@ public class WebServer {
Response response = getResponse(target, user);
String content = response.getContent();
exchange.sendResponseHeaders(200, 0);
exchange.sendResponseHeaders(response.getCode(), 0);
try (BufferedOutputStream out = new BufferedOutputStream(exchange.getResponseBody());
ByteArrayInputStream bis = new ByteArrayInputStream(content.getBytes())) {