Ticket #4549: django-admin-mimetype.patch
File django-admin-mimetype.patch, 862 bytes (added by , 17 years ago) |
---|
-
django/core/servers/basehttp.py
9 9 10 10 from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer 11 11 from types import ListType, StringType 12 import os, re, sys, time, urllib 12 import os, re, sys, time, urllib, mimetypes 13 13 14 14 __version__ = "0.1" 15 15 __all__ = ['WSGIServer','WSGIRequestHandler','demo_app'] … … 630 630 else: 631 631 status = '200 OK' 632 632 headers = {} 633 mime_type = mimetypes.guess_type(file_path)[0] 634 if mime_type: 635 headers['Content-Type'] = mime_type 633 636 output = [fp.read()] 634 637 fp.close() 635 638 start_response(status, headers.items())