kopia lustrzana https://github.com/gaul/s3proxy
Merge e0a1cf7657
into d503c07655
commit
d9f020b493
|
@ -297,6 +297,12 @@ public class S3ProxyHandler {
|
|||
String uri = request.getRequestURI();
|
||||
String originalUri = request.getRequestURI();
|
||||
|
||||
// Check for the /version endpoint
|
||||
if ("/healthz".equals(uri) && "GET".equalsIgnoreCase(method)) {
|
||||
handleVersionRequest(response);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.servicePath.isEmpty()) {
|
||||
if (uri.length() > this.servicePath.length()) {
|
||||
uri = uri.substring(this.servicePath.length());
|
||||
|
@ -2039,6 +2045,18 @@ public class S3ProxyHandler {
|
|||
|
||||
response.addHeader(HttpHeaders.ETAG, maybeQuoteETag(eTag));
|
||||
}
|
||||
private void handleVersionRequest(HttpServletResponse response) throws IOException {
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
response.setContentType("application/json");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
|
||||
String versionInfo = "{ \"status\": \"OK\"}";
|
||||
|
||||
try (PrintWriter writer = response.getWriter()) {
|
||||
writer.write(versionInfo);
|
||||
writer.flush();
|
||||
}
|
||||
}
|
||||
|
||||
private void handlePostBlob(HttpServletRequest request,
|
||||
HttpServletResponse response, InputStream is, BlobStore blobStore,
|
||||
|
|
Ładowanie…
Reference in New Issue