Set velocity view content type to HTML. Previously the content type was not set and it was left to the Browser to properly understand the result output. That sometimes generated a plaintext HTML in some browsers. Change-Id: I5c9fd2cf5444dcd343d0d378df6df9353c06cf2c
diff --git a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/velocity/VelocityViewServlet.java b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/velocity/VelocityViewServlet.java index b17f858..21a88e7 100644 --- a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/velocity/VelocityViewServlet.java +++ b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/velocity/VelocityViewServlet.java
@@ -16,6 +16,7 @@ import java.io.IOException; import java.util.Map.Entry; +import javax.mail.internet.ContentType; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; @@ -88,6 +89,7 @@ Template template = velocityRuntime.getTemplate(pathInfo, "UTF-8"); VelocityContext context = initVelocityModel(req).getContext(); context.put("request", req); + resp.setHeader("content-type", "text/html"); template.merge(context, resp.getWriter()); } catch (ResourceNotFoundException e) { log.error("Cannot load velocity template " + pathInfo, e);