Opened 4 years ago

Closed 4 years ago

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

Change History (2)

comment:1 Changed 4 years ago by sebastian

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

comment:2 Changed 4 years ago by sebastian

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.