tests/tinyproxy.py
changeset 14093 ce99d887585f
parent 10282 08a0f04b56bd
child 14494 1ffeeb91c55d
--- a/tests/tinyproxy.py	Sat Apr 30 19:36:48 2011 +0200
+++ b/tests/tinyproxy.py	Sun May 01 01:04:37 2011 +0800
@@ -30,6 +30,12 @@
         else:
             self.__base_handle()
 
+    def log_request(self, code='-', size='-'):
+        xheaders = [h for h in self.headers.items() if h[0].startswith('x-')]
+        self.log_message('"%s" %s %s%s',
+                         self.requestline, str(code), str(size),
+                         ''.join([' %s:%s' % h for h in sorted(xheaders)]))
+
     def _connect_to(self, netloc, soc):
         i = netloc.find(':')
         if i >= 0: