From 3d4c61b84b172c3180b0ad76f3c64a06844cd129 Mon Sep 17 00:00:00 2001 From: Axel Uhl Date: Sun, 26 Apr 2020 15:33:03 +0200 Subject: [PATCH] explicitly set text/html as the conntent-type response header field in ClientConfigurationServlet; this as temporary aftermath for bug5153 to make sure clients take HTML documents as such and not as the default text/plain as reported for some cases when the URL contained queries, e.g., for sailtracks.sapsailing.com --- java/com.sap.sse.debranding/META-INF/MANIFEST.MF | 1 + .../src/com/sap/sse/debranding/ClientConfigurationServlet.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/java/com.sap.sse.debranding/META-INF/MANIFEST.MF b/java/com.sap.sse.debranding/META-INF/MANIFEST.MF index c2a3e538351..c78b35ed0da 100644 --- a/java/com.sap.sse.debranding/META-INF/MANIFEST.MF +++ b/java/com.sap.sse.debranding/META-INF/MANIFEST.MF @@ -8,6 +8,7 @@ Bundle-Vendor: SAP Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: javax.servlet;version="3.1.0", javax.servlet.http;version="3.1.0", + javax.ws.rs.core;version="1.1.1", org.apache.http Bundle-ClassPath: . Bundle-ActivationPolicy: lazy diff --git a/java/com.sap.sse.debranding/src/com/sap/sse/debranding/ClientConfigurationServlet.java b/java/com.sap.sse.debranding/src/com/sap/sse/debranding/ClientConfigurationServlet.java index 3aa53f96415..b1da779bda8 100644 --- a/java/com.sap.sse.debranding/src/com/sap/sse/debranding/ClientConfigurationServlet.java +++ b/java/com.sap.sse.debranding/src/com/sap/sse/debranding/ClientConfigurationServlet.java @@ -12,6 +12,7 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.core.MediaType; import org.apache.commons.io.IOUtils; import org.apache.http.HttpStatus; @@ -82,6 +83,7 @@ public class ClientConfigurationServlet extends HttpServlet { final String servletPath = req.getServletPath(); final byte[] cachedPage; final String pageKey = generateKey(servletPath, deBrandingActive); + resp.setContentType(MediaType.TEXT_HTML); if ((cachedPage = cache.get(pageKey)) != null) { IOUtils.write(cachedPage, resp.getOutputStream()); } else {