mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
test for gui handler
This commit is contained in:
parent
b02126c1cc
commit
b164d71199
2 changed files with 20 additions and 3 deletions
|
|
@ -29,10 +29,11 @@ abstract class BaseHandler implements HttpHandler {
|
|||
os.close();
|
||||
}
|
||||
|
||||
protected static void error(final HttpExchange httpExchange, final int statusCode, final String message) throws IOException {
|
||||
protected static void error(final HttpExchange exchange, final int statusCode, final String message) throws IOException {
|
||||
final byte[] bytes = message.getBytes();
|
||||
httpExchange.sendResponseHeaders(statusCode, bytes.length);
|
||||
final OutputStream os = httpExchange.getResponseBody();
|
||||
exchange.getResponseHeaders().add("Content-Type", "text/plain");
|
||||
exchange.sendResponseHeaders(statusCode, bytes.length);
|
||||
final OutputStream os = exchange.getResponseBody();
|
||||
os.write(bytes);
|
||||
os.close();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue