Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(563)

Unified Diff: net/tools/testserver/testserver.py

Issue 10873: Don't send Content-Type when redirecting from a POST.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/data/url_request_unittest/redirect-to-echoall.mock-http-headers ('k') | net/url_request/url_request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/testserver/testserver.py
===================================================================
--- net/tools/testserver/testserver.py (revision 5515)
+++ net/tools/testserver/testserver.py (working copy)
@@ -88,6 +88,7 @@
self.DownloadHandler,
self.DownloadFinishHandler,
self.EchoHeader,
+ self.EchoAllHandler,
self.FileHandler,
self.RealFileWithCommonHeaderHandler,
self.RealBZ2FileWithCommonHeaderHandler,
@@ -419,13 +420,15 @@
'<div style="float: right">'
'<a href="http://localhost:8888/echo">back to referring page</a></div>'
'<h1>Request Body:</h1><pre>')
- length = int(self.headers.getheader('content-length'))
- qs = self.rfile.read(length)
- params = cgi.parse_qs(qs, keep_blank_values=1)
- for param in params:
- self.wfile.write('%s=%s\n' % (param, params[param][0]))
+ if self.command == 'POST':
+ length = int(self.headers.getheader('content-length'))
+ qs = self.rfile.read(length)
+ params = cgi.parse_qs(qs, keep_blank_values=1)
+ for param in params:
+ self.wfile.write('%s=%s\n' % (param, params[param][0]))
+
self.wfile.write('</pre>')
self.wfile.write('<h1>Request Headers:</h1><pre>%s</pre>' % self.headers)
« no previous file with comments | « net/data/url_request_unittest/redirect-to-echoall.mock-http-headers ('k') | net/url_request/url_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698