diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-06-25 12:47:19 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-06-25 12:47:19 +0000 |
| commit | 0ced8b0bb211fca38669293b15316930e0d648fd (patch) | |
| tree | a6f4733859aed03765c396f843770b503c36ec90 /django/core/servers/basehttp.py | |
| parent | f4387422f0a556fb2469500fb9d408306bead02c (diff) | |
unicode: Merged from trunk up to [5530]. Oracle backend has not been ported to
support unicode yet.
git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5531 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/servers/basehttp.py')
| -rw-r--r-- | django/core/servers/basehttp.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/core/servers/basehttp.py b/django/core/servers/basehttp.py index 80a0bf6a91..64ed739473 100644 --- a/django/core/servers/basehttp.py +++ b/django/core/servers/basehttp.py @@ -9,7 +9,7 @@ been reviewed for security issues. Don't use it for production use. from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from types import ListType, StringType -import os, re, sys, time, urllib +import os, re, sys, time, urllib, mimetypes __version__ = "0.1" __all__ = ['WSGIServer','WSGIRequestHandler','demo_app'] @@ -630,6 +630,9 @@ class AdminMediaHandler(object): else: status = '200 OK' headers = {} + mime_type = mimetypes.guess_type(file_path)[0] + if mime_type: + headers['Content-Type'] = mime_type output = [fp.read()] fp.close() start_response(status, headers.items()) |
