summaryrefslogtreecommitdiffstats
path: root/net/tools
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-02 17:59:55 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-02 17:59:55 +0000
commitb77c6c1ddc8b9904c2080d8259a33da3d5715d56 (patch)
tree8abc7145ca3b30a2077916aef961ad7b90ff487f /net/tools
parentd0e155cca5679b0b02b8147dd90c8a2a66bf272c (diff)
downloadchromium_src-b77c6c1ddc8b9904c2080d8259a33da3d5715d56.zip
chromium_src-b77c6c1ddc8b9904c2080d8259a33da3d5715d56.tar.gz
chromium_src-b77c6c1ddc8b9904c2080d8259a33da3d5715d56.tar.bz2
The Python test server now ignores querystrings params when serving local files.
I'm having no luck getting the try bots to recognize this change to the python file, so I am separating my already LG'ed changelist (http://codereview.chromium.org/246066) into two (this part and a followup patch) in the hopes that my tests (next CL) will succeed. I fixed our python test server to serve files even though there is a querystring in the url (the server basically just ignores the querystring). This is needed in my next cl because the html we serve has js that acts on data in the querystring. Also made it have the right content-header when serving xml files (text/html). TBR=aa BUG=None TEST=None Review URL: http://codereview.chromium.org/242120 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27862 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/tools')
-rw-r--r--net/tools/testserver/testserver.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py
index 065ea7b..b80a939 100644
--- a/net/tools/testserver/testserver.py
+++ b/net/tools/testserver/testserver.py
@@ -134,7 +134,8 @@ class TestPageHandler(BaseHTTPServer.BaseHTTPRequestHandler):
self._mime_types = {
'gif': 'image/gif',
'jpeg' : 'image/jpeg',
- 'jpg' : 'image/jpeg'
+ 'jpg' : 'image/jpeg',
+ 'xml' : 'text/xml'
}
self._default_mime_type = 'text/html'
@@ -586,7 +587,12 @@ class TestPageHandler(BaseHTTPServer.BaseHTTPRequestHandler):
self.rfile.read(int(self.headers.getheader('content-length')))
file = self.path[len(prefix):]
- entries = file.split('/');
+ if file.find('?') > -1:
+ # Ignore the query parameters entirely.
+ url, querystring = file.split('?')
+ else:
+ url = file
+ entries = url.split('/')
path = os.path.join(self.server.data_dir, *entries)
if os.path.isdir(path):
path = os.path.join(path, 'index.html')