Skip to content

Commit b7e546b

Browse files
authored
Merge branch 'main' into SITES-28486
2 parents a891bca + 9d8d19b commit b7e546b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/servlets/CoreFormHandlingServlet.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ protected void activate(Configuration configuration) {
110110
@Override
111111
protected void doPost(@NotNull SlingHttpServletRequest request, @NotNull final SlingHttpServletResponse response)
112112
throws ServletException, IOException {
113+
// response will have content type text/html since it is represented by a JSP without another content type set
114+
// JSPs have this content type by default
115+
// So set this content type in advance inside response, in order to avoid breaking request dispatcher contract
116+
// More info https://jakarta.ee/specifications/servlet/4.0/apidocs/javax/servlet/requestdispatcher#include-javax.servlet.ServletRequest-javax.servlet.ServletResponse-
117+
response.setContentType("text/html");
113118
formsHandlingServletHelper.doPost(request, response);
114119
}
115120

0 commit comments

Comments
 (0)