This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push: new c28d4d7 Fix BZ 65921 - type sets content-type for response not request c28d4d7 is described below commit c28d4d702bf44b14076b84ce22dc2585cb54a939 Author: Mark Thomas <ma...@apache.org> AuthorDate: Tue Mar 1 13:02:52 2022 +0000 Fix BZ 65921 - type sets content-type for response not request https://bz.apache.org/bugzilla/show_bug.cgi?id=65921 --- java/org/apache/catalina/valves/rewrite/RewriteValve.java | 2 +- webapps/docs/changelog.xml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/java/org/apache/catalina/valves/rewrite/RewriteValve.java b/java/org/apache/catalina/valves/rewrite/RewriteValve.java index 9277e3c..07f718d 100644 --- a/java/org/apache/catalina/valves/rewrite/RewriteValve.java +++ b/java/org/apache/catalina/valves/rewrite/RewriteValve.java @@ -445,7 +445,7 @@ public class RewriteValve extends ValveBase { // - content type (note: this will not force the content type, use a filter // to do that) if (rule.isType() && newtest != null) { - request.setContentType(rule.getTypeValue()); + response.setContentType(rule.getTypeValue()); } // Control flow processing diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 69c4e07..ba37c6b 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -112,6 +112,11 @@ Apache Log4j JAR for Jakarta EE platforms. Pull request by Michael Seele. (markt) </fix> + <fix> + <bug>65921</bug>: The <code>type</code> substitution flag for the + rewrite valve should set the content type for the response, not the + request. (markt) + </fix> </changelog> </subsection> <subsection name="Coyote"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org