This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new 3d226a2 Fix BZ 65921 - type sets content-type for response not request
3d226a2 is described below
commit 3d226a24626490eac836a2234930eed80e33bf75
Author: Mark Thomas <[email protected]>
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 | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/catalina/valves/rewrite/RewriteValve.java
b/java/org/apache/catalina/valves/rewrite/RewriteValve.java
index d0f2878..4be21fc 100644
--- a/java/org/apache/catalina/valves/rewrite/RewriteValve.java
+++ b/java/org/apache/catalina/valves/rewrite/RewriteValve.java
@@ -461,7 +461,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 9263dea..877cbec 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,15 @@
issues do not "pop up" wrt. others).
-->
<section name="Tomcat 8.5.77 (schultz)" rtext="In development">
+ <subsection name="Catalina">
+ <changelog>
+ <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">
<changelog>
<fix>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]