Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit 3182e31

Browse files
David Tesarrguthriemsft
authored andcommitted
Remove java api healthcheck header requirement (#70)
* rm header requirement from healthcheck * ignore local java configs
1 parent 573bb85 commit 3182e31

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

apis/user-java/.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
target
1+
target
2+
.project
3+
.settings
4+
.classpath

apis/user-java/src/main/java/io/swagger/api/HealthcheckApiController.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,13 @@ public HealthcheckApiController(ObjectMapper objectMapper, HttpServletRequest re
3939
}
4040

4141
public ResponseEntity<Healthcheck> healthcheckUserGet() {
42-
String accept = request.getHeader("Accept");
43-
if (accept != null) {
44-
try {
45-
return new ResponseEntity<Healthcheck>(objectMapper.readValue("{ \"message\" : \"healthcheck\", \"status\" : \"healthy\"}", Healthcheck.class), HttpStatus.OK);
46-
} catch (IOException e) {
47-
log.error("Couldn't serialize response for content type application/json", e);
48-
return new ResponseEntity<Healthcheck>(HttpStatus.INTERNAL_SERVER_ERROR);
49-
}
50-
}
5142

52-
return new ResponseEntity<Healthcheck>(HttpStatus.NOT_IMPLEMENTED);
43+
try {
44+
return new ResponseEntity<Healthcheck>(objectMapper.readValue("{ \"message\" : \"healthcheck\", \"status\" : \"healthy\"}", Healthcheck.class), HttpStatus.OK);
45+
} catch (IOException e) {
46+
log.error("Couldn't serialize response for content type application/json", e);
47+
return new ResponseEntity<Healthcheck>(HttpStatus.INTERNAL_SERVER_ERROR);
48+
}
5349
}
5450

5551
}

0 commit comments

Comments
 (0)