From 473aef1d763b3f05b031e901f2209e8d49f8e597 Mon Sep 17 00:00:00 2001 From: "ericroman@google.com" Date: Thu, 7 May 2009 03:51:05 +0000 Subject: 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 . Original code review: Review URL: http://codereview.chromium.org/115058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15510 0039d316-1c4b-4281-b951-d872f2087c98 --- net/tools/testserver/testserver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'net/tools') 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" -- cgit v1.1