From 6d7f082a6b7c5159725323d1c97030c7f7d21322 Mon Sep 17 00:00:00 2001 From: Mohamed Rashd Date: Tue, 1 Mar 2022 09:36:52 +0530 Subject: [PATCH] Fix grafana translation not working properly --- .../java/io/entgra/ui/request/interceptor/GrafanaHandler.java | 2 ++ .../io/entgra/ui/request/interceptor/util/HandlerConstants.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/GrafanaHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/GrafanaHandler.java index 3ac99b1044..6cd8872eae 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/GrafanaHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/GrafanaHandler.java @@ -48,6 +48,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URI; +import java.nio.charset.StandardCharsets; @MultipartConfig @WebServlet( @@ -150,6 +151,7 @@ public class GrafanaHandler extends HttpServlet { resp.setContentType(contentType); resp.setStatus(grafanaAPIResponse.getCode()); addXFrameOptionsHeaders(resp); + resp.setCharacterEncoding(StandardCharsets.UTF_8.name()); resp.getWriter().print(grafanaAPIResponse.getData()); } diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java index df0e085b0a..153ace868a 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java @@ -84,7 +84,7 @@ public class HandlerConstants { public static final String WSS_PROTOCOL = "wss"; public static final String WS_PROTOCOL = "ws"; public static final String REMOTE_SESSION_CONTEXT = "/remote/session/clients"; - public static final String GRAFANA_API = "/api/device-mgt/v1.0/reports/grafana"; + public static final String GRAFANA_API = "/api/grafana-mgt/v1.0"; public static final String IOT_CORE_HOST_ENV_VAR = "iot.core.host"; public static final String IOT_CORE_HTTP_PORT_ENV_VAR = "iot.core.http.port";