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):

http://codereview.adblockplus.org/5640548127866880

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().

Attachments (0)

Change History (2)

comment:1 Changed on 06/12/2015 at 09:41:30 PM by sebastian

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed on 06/15/2015 at 04:16:08 PM by sebastian

  • Resolution set to fixed
  • Status changed from reviewing to closed

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from sebastian.
 
Note: See TracTickets for help on using tickets.