You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2017/10/15 23:07:08 UTC
[Bug 61621] New: Content-Type is forced to lowercase when it goes
through mod_jk
https://bz.apache.org/bugzilla/show_bug.cgi?id=61621
Bug ID: 61621
Summary: Content-Type is forced to lowercase when it goes
through mod_jk
Product: Tomcat Connectors
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P2
Component: mod_jk
Assignee: dev@tomcat.apache.org
Reporter: odoma04@ca.com
Target Milestone: ---
Running our proxied request via mod_jk we are seeing the returned content-type
being changing to all lowercase:
eg:
Content-Type: application/xxx.yyyy.dddd+JSON; charset=utf-8
to:
Content-Type: application/xxx.yyyy.dddd+json; charset=utf-8
We thought this was tomcat at first, but turns out to be mod_jk.c that is the
cause :
http://svn.apache.org/repos/asf/tomcat/jk/trunk/native/apache-2.0/mod_jk.c
for (h = 0; h < num_of_headers; h++) {
if (!strcasecmp(header_names[h], "Content-type")) {
char *tmp = apr_pstrdup(r->pool, header_values[h]);
ap_content_type_tolower(tmp);
/* It should be done like this in Apache 2.0 */
/* This way, Apache 2.0 will be able to set the output filter */
/* and it make jk useable with deflate using */
/* AddOutputFilterByType DEFLATE text/html */
ap_set_content_type(r, tmp);
}
Now on the validity of upper vs lower - it seems a little bit of a grey area:
https://www.w3.org/Protocols/rfc1341/4_Content-Type.html
The type, subtype, and parameter names are not case sensitive. For example,
TEXT, Text, and TeXt are all equivalent. Parameter values are normally case
sensitive, but certain parameters are interpreted to be case- insensitive,
depending on the intended use. (For example, multipart boundaries are
case-sensitive, but the "access- type" for message/External-body is not
case-sensitive.)
In our usage we are acting as a proxy, and as a proxy we dont have an opinion
on if it should be forced to lower case or allow mixed case - we just want to
pass on what we get :-) - but certainly some JkOption may be useful way to
retain original behaviour but allow overwriting.
Also if we run the request via mod_proxy/mod_proxy_ajp.c instead then the
returned content-type header is not changed.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 61621] Content-Type is forced to lowercase when it goes through
mod_jk
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61621
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
--- Comment #1 from Mark Thomas <ma...@apache.org> ---
It is worth noting that ap_content_type_to_lower() only changes the type and
sub-type. Parameter names and values remain unchanged.
Removing this call in mod_jk breaks the use of AddOutputFilterByType.
Testing with mod_proxy confirms that it doesn't change the case of the
Content-type but also demonstrates that the use of AddOutputFilterByType is
broken with mod_proxy if the Content-type is not lower case.
I looked, but could not find, any bug reports against mod_proxy for
AddOutputFilterByType not working.
I don't have any objections to making the mod_jk behaviour configurable
although I do think that the current behaviour should remain the default. I am
therefore moving this issue to an enhancement request.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 61621] Content-Type is forced to lowercase when it goes through
mod_jk
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61621
Hazem Hosny <ma...@yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Alias| |Mark, dony
--- Comment #2 from Hazem Hosny <ma...@yahoo.com> ---
No comment
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org