Opened on 06/12/2015 at 09:39:45 PM
Closed on 06/15/2015 at 04:16:08 PM
#2678 closed defect (fixed)
[cms] Development server considers global files and Windows registry for mimetypes
Reported by: | sebastian | Assignee: | sebastian |
---|---|---|---|
Priority: | P2 | Milestone: | |
Module: | Sitescripts | Keywords: | |
Cc: | trev | Blocked By: | |
Blocking: | Platform: | Unknown | |
Ready: | yes | Confidential: | no |
Tester: | Verified working: | no | |
Review URL(s): |
Description
Observed behaviour
If you have conflicting software (e.g. AdobeAAMDetect) installed, you get a generic 404 page (on Chrome) when requesting any page with the development server. Or some pages might be downloaded instead.
Background
This is because registry entries (or global files under UNIX) are considered when mapping file extensions to mime types. We have been aware of that scenario and thought to have it already addressed by initializing our own MimeTypes instance. This however has no effect, since it still calls mimetypes.init() and considers global variables set by that function.
What to change
We have to call mimetypes.init([]). Passing an empty list is crucial. Then it doesn't even matter whether we use our own MimeTypes object or simply call mimetypes.guess_type().
https://hg.adblockplus.org/cms/rev/698f274a0007