| Index: cms/bin/test_server.py |
| =================================================================== |
| --- a/cms/bin/test_server.py |
| +++ b/cms/bin/test_server.py |
| @@ -46,9 +46,9 @@ |
| </body> |
| </html>""" |
| -# Create our own instance, the default one will introduce "random" host-specific |
| -# behavior by parsing local config files. |
| -mime_types = mimetypes.MimeTypes() |
| +# Initilize the mimetypes modules manually for consistent behavior, |
| +# ignoring local files and Windows Registry. |
| +mimetypes.init([]) |
|
Wladimir Palant
2015/06/29 10:42:32
Re-reading the source code I can see the issue - M
|
| def get_page(path): |
| path = path.strip("/") |
| @@ -105,7 +105,7 @@ |
| if data is None: |
| return show_error(start_response, "404 Not Found", uri=path) |
| - mime = mime_types.guess_type(path)[0] or "text/html" |
| + mime = mimetypes.guess_type(path)[0] or "text/html" |
| if isinstance(data, unicode): |
| data = data.encode(UNICODE_ENCODING) |