Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicReference;

import static com.dslplatform.json.JsonWriter.ARRAY_END;
import static com.dslplatform.json.JsonWriter.ARRAY_START;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,19 +404,24 @@ public List<String> getReceivedBodyLines() {
private HttpHandler httpHandler() {
return exchange -> {

InputStream requestBody = exchange.getRequestBody();
if (requestBody != null) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(requestBody))) {
String line = reader.readLine();
if (!line.isEmpty()) {
requestBodyLines.add(line);
String response;
if (exchange.getRequestURI().getPath().equals("/")) { // health check
response = "{\"version\" : \"8.7.1\"}";
} else {
InputStream requestBody = exchange.getRequestBody();
if (requestBody != null) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(requestBody))) {
String line = reader.readLine();
if (!line.isEmpty()) {
requestBodyLines.add(line);
}
}
}
response = "{}";
}

String response = "{}";
exchange.sendResponseHeaders(200, response.getBytes().length);
exchange.getResponseBody().write(response.getBytes());
exchange.close();
};
}

Expand Down