File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
main/java/co/elastic/apm/agent/report/serialize
test/java/co/elastic/apm/agent/configuration Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 8787import java .util .concurrent .Future ;
8888import java .util .concurrent .TimeUnit ;
8989import java .util .concurrent .TimeoutException ;
90- import java .util .concurrent .atomic .AtomicReference ;
9190
9291import static com .dslplatform .json .JsonWriter .ARRAY_END ;
9392import static com .dslplatform .json .JsonWriter .ARRAY_START ;
Original file line number Diff line number Diff line change @@ -404,19 +404,24 @@ public List<String> getReceivedBodyLines() {
404404 private HttpHandler httpHandler () {
405405 return exchange -> {
406406
407- InputStream requestBody = exchange .getRequestBody ();
408- if (requestBody != null ) {
409- try (BufferedReader reader = new BufferedReader (new InputStreamReader (requestBody ))) {
410- String line = reader .readLine ();
411- if (!line .isEmpty ()) {
412- requestBodyLines .add (line );
407+ String response ;
408+ if (exchange .getRequestURI ().getPath ().equals ("/" )) { // health check
409+ response = "{\" version\" : \" 8.7.1\" }" ;
410+ } else {
411+ InputStream requestBody = exchange .getRequestBody ();
412+ if (requestBody != null ) {
413+ try (BufferedReader reader = new BufferedReader (new InputStreamReader (requestBody ))) {
414+ String line = reader .readLine ();
415+ if (!line .isEmpty ()) {
416+ requestBodyLines .add (line );
417+ }
413418 }
414419 }
420+ response = "{}" ;
415421 }
416-
417- String response = "{}" ;
418422 exchange .sendResponseHeaders (200 , response .getBytes ().length );
419423 exchange .getResponseBody ().write (response .getBytes ());
424+ exchange .close ();
420425 };
421426 }
422427
You can’t perform that action at this time.
0 commit comments