Skip to content

Commit 41c0f89

Browse files
authored
Fixed localized strings for htmlMessageSuccess (#511)
1 parent 9615519 commit 41c0f89

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/com/microsoft/aad/msal4j/AuthorizationResponseHandler.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,11 @@ private void send302Response(HttpExchange httpExchange, String redirectUri) thro
100100
}
101101

102102
private void send200Response(HttpExchange httpExchange, String response) throws IOException {
103-
httpExchange.sendResponseHeaders(200, response.length());
103+
byte[] responseBytes = response.getBytes("UTF-8");
104+
httpExchange.getResponseHeaders().set("Content-Type", "text/html; charset=UTF-8");
105+
httpExchange.sendResponseHeaders(200, responseBytes.length);
104106
OutputStream os = httpExchange.getResponseBody();
105-
os.write(response.getBytes("UTF-8"));
107+
os.write(responseBytes);
106108
os.close();
107109
}
108110

0 commit comments

Comments
 (0)