You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2022/03/01 13:03:49 UTC

[tomcat] branch 10.0.x updated: Fix BZ 65921 - type sets content-type for response not request

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.0.x by this push:
     new 81e36bb  Fix BZ 65921 - type sets content-type for response not request
81e36bb is described below

commit 81e36bb50f3dd6a43bbe0a92a1af1f98f1321f41
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 e50205d..40caf73 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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org