Abdulrahman azmy 2025-09-04 11:00:58 +03:00 zatwierdzone przez GitHub
commit d9f020b493
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 18 dodań i 0 usunięć

Wyświetl plik

@ -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,