tflobbe commented on code in PR #1122:
URL: https://github.com/apache/solr/pull/1122#discussion_r1004697676
##########
solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.java:
##########
@@ -70,20 +67,13 @@ public void doGet(HttpServletRequest _request,
HttpServletResponse _response) th
// We have to close this to flush OutputStreamWriter buffer
out =
new OutputStreamWriter(
- new CloseShieldOutputStream(response.getOutputStream()),
StandardCharsets.UTF_8);
+ CloseShieldOutputStream.wrap(response.getOutputStream()),
StandardCharsets.UTF_8);
- String html = IOUtils.toString(in, "UTF-8");
Package pack = SolrCore.class.getPackage();
-
- String[] search = new String[] {"${contextPath}", "${adminPath}",
"${version}"};
- String[] replace =
- new String[] {
- StringEscapeUtils.escapeEcmaScript(request.getContextPath()),
-
StringEscapeUtils.escapeEcmaScript(CommonParams.CORES_HANDLER_PATH),
-
StringEscapeUtils.escapeEcmaScript(pack.getSpecificationVersion())
- };
-
- out.write(StringUtils.replaceEach(html, search, replace));
+ String html =
+ IOUtils.toString(in, StandardCharsets.UTF_8)
+ .replace("${version}", pack.getSpecificationVersion());
+ out.write(html);
Review Comment:
Guessing we don't need the other replacements?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]