Bug 64237 - Mime-mapping for *.Z files is missing in default configuration of Tomcat 7.0.103
Summary: Mime-mapping for *.Z files is missing in default configuration of Tomcat 7.0.103
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 7.0.103
Hardware: PC All
: P2 regression (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-18 14:17 UTC by Konstantin Kolinko
Modified: 2020-03-30 15:43 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Kolinko 2020-03-18 14:17:01 UTC
The following commit removed the <mime-mapping> for "Z" files from the default conf/web.xml, under assumption that Tomcat 7 processes mime mappings in case-insensitive manner:

https://github.com/apache/tomcat/commit/fa587753d13125573118cfd6bad46dce6088b857

Smoke-testing Tomcat 7.0.103, it does not.

Using a sample file, placed into the ROOT webapp (named "foo.Z", then "foo.z"):

wget.exe --save-headers http://localhost:8080/foo.Z
[[[
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Accept-Ranges: bytes
ETag: W/"6-1584539021767"
Last-Modified: Wed, 18 Mar 2020 13:43:41 GMT
Content-Length: 6
Date: Wed, 18 Mar 2020 13:46:45 GMT

Test
]]]

wget.exe --save-headers http://localhost:8080/foo.z
[[[
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Accept-Ranges: bytes
ETag: W/"6-1584539021767"
Last-Modified: Wed, 18 Mar 2020 13:43:41 GMT
Content-Type: application/x-compress
Content-Length: 6
Date: Wed, 18 Mar 2020 13:47:44 GMT

Test
]]]

The Content-Type header is missing from the first response.
Testing Tomcat 8.5.53, it returns Content-Type header as expected.


One of the options to fix this is to backport case-insensitive mime-type mapping to Tomcat 7. The feature was implemented in Tomcat 8.0.0 with r1356151:

https://bz.apache.org/bugzilla/show_bug.cgi?id=45995
https://github.com/apache/tomcat/commit/2a18548f51cf89694077f4f72605190a8e7a427e
Comment 1 Konstantin Kolinko 2020-03-18 14:19:32 UTC
Not a show-stopper. Anyone affected can edit their own conf/web.xml file. Also I think that *.Z files are rarely used nowadays. It is an old compression format.
Comment 2 Mark Thomas 2020-03-30 15:17:39 UTC
I can neither recall nor find regressions associated with the switch to case insensitive mapping so I plan to back-port that change to 7.0.x shortly.
Comment 3 Mark Thomas 2020-03-30 15:43:34 UTC
Fixed in:
- 7.0.x for 7.0.104 onwards