summaryrefslogtreecommitdiffstats
path: root/net/tools
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-07 03:51:05 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-07 03:51:05 +0000
commit473aef1d763b3f05b031e901f2209e8d49f8e597 (patch)
treef98bafa20c5b6b62214d087a7c7f8ce673bbf616 /net/tools
parentf5e64aa4287044e9439764236b8fbdc90edaaeb0 (diff)
downloadchromium_src-473aef1d763b3f05b031e901f2209e8d49f8e597.zip
chromium_src-473aef1d763b3f05b031e901f2209e8d49f8e597.tar.gz
chromium_src-473aef1d763b3f05b031e901f2209e8d49f8e597.tar.bz2
Fix testserver to return a correct MIME-type header.
Originally, testserver was sending "Content-type: text/html" header regardless of a file extension, due to a bug in TestPageHandler.GetMIMETypeFromName. Patch by Yuta Kitamura <yutak@google.com>. Original code review: <http://codereview.chromium.org/100357> Review URL: http://codereview.chromium.org/115058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15510 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/tools')
-rw-r--r--net/tools/testserver/testserver.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py
index 9ab77a8..a27b534 100644
--- a/net/tools/testserver/testserver.py
+++ b/net/tools/testserver/testserver.py
@@ -150,7 +150,8 @@ class TestPageHandler(BaseHTTPServer.BaseHTTPRequestHandler):
# no extension.
return self._default_mime_type
- return self._mime_types.get(extension, self._default_mime_type)
+ # extension starts with a dot, so we need to remove it
+ return self._mime_types.get(extension[1:], self._default_mime_type)
def KillHandler(self):
"""This request handler kills the server, for use when we're done"